I want to do this :
file_name = 'file'
link_name = 'rep\' + file_name
print(link_name)
But I get this error message :
SyntaxError: EOL while scanning string literal
I want to do this :
file_name = 'file'
link_name = 'rep\' + file_name
print(link_name)
But I get this error message :
SyntaxError: EOL while scanning string literal
Instead of using \
you have to use \\
file_name = 'file'
link_name = 'rep\\' + file_name
print(link_name)
or if you really, really want a backslash use this:
file_name = 'file'
link_name = 'rep' + chr(92) + file_name
print(link_name)