I have a code where I try to get a path from an input so this program could append info to another text file.
file1 = input("Input the file path:\n")
file2 = file1.replace("\", "/")
file2 = file1.replace("\", "/")
^
SyntaxError: EOL while scanning string literal
I get this problem and it seems to be because the \ is not seen as a string (if I put \n for example it does work but I need to replace )
An alternative for replacing \ with / could also fix my problem. I used to use r"filepath" but I can't do that with an input I think. I just need to make the input into a raw string.