Python Forum
[solved] unexpected character after line continuation character
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] unexpected character after line continuation character
#1
Hi

To higlight reading by adding comments, I'm looking for a way to split function arguments into several lines; nevertheless using backslash I'm facing to an error (I'm still digging on internet in how to fix it): is there a workaround?

Thanks

Paul

mymodule.myfunction(path, file, arg1, arg2)

mymodule.myfunction(path,   \# comment1
                    file,     \# comment2
                    arg1,   \# comment3
                    arg2)
Error:
SyntaxError: unexpected character after line continuation character
Reply


Messages In This Thread
[solved] unexpected character after line continuation character - by paul18fr - Jun-21-2021, 01:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python rule about the space character surrounding the equal sign ineuw 10 1,636 Sep-21-2023, 09:17 AM
Last Post: ineuw
  How do I handle escape character in parameter arguments in Python? JKR 6 1,175 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
Question UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 562: ord ctrldan 23 4,865 Apr-24-2023, 03:40 PM
Last Post: ctrldan
  use of escape character in re.sub and find WJSwan 1 920 Feb-16-2023, 05:19 PM
Last Post: Larz60+
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,386 Sep-27-2022, 01:38 PM
Last Post: buran
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 34: character Melcu54 7 19,042 Sep-26-2022, 10:09 AM
Last Post: Melcu54
  Unsupported Format Character Led_Zeppelin 2 5,414 Sep-20-2022, 01:46 PM
Last Post: deanhystad
  how to read chinese character? kucingkembar 2 1,370 Aug-25-2022, 08:42 PM
Last Post: kucingkembar
  How to split the input taken from user into a single character? mHosseinDS86 3 1,184 Aug-17-2022, 12:43 PM
Last Post: Pedroski55
  UnicodeEncodeError: 'ascii' codec can't encode character '\xfd' in position 14: ordin Armandito 6 2,738 Apr-29-2022, 12:36 PM
Last Post: Armandito

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020