Note: the above code looks OK on the surface, but an error is reported: syntax error: unexpected character after line continuation character.
The reason for the problem here is:
There is a space after the line break ‘\’ on the first line. When there is a space after the newline character, the program will report an error.
Very simple, just delete the spaces after the newline character “\” and the problem is solved.
In other words, nothing else is allowed after the newline character. Include comments#
- [Solved] Dom4j parsing XML file error: invalid XML character (Unicode: 0x8)
- Solution of syntax error: invalid character in identifier when writing Python code
- [Solved] Expected linebreaks to be ‘LF’ but found ‘CRLF’.
- One line command / usr / bin / Perl ^ m: bad interpreter
- [Solved] error: ‘gets’ was not declared in this scope; did you mean ‘fgets’?
- [Solved] Springboot Error: found character ‘@’ that cannot start any token. (Do not use @ for indentation)
- The difference between UTF-8 and utf-8-sig
- [Solved] A label can only be part of statement and a declaratioin is not a statement
- Python SyntaxError: unexpected character after line continuation character
- TabError: inconsistent use of tabs and spaces in indentation