Reputation: 23
While programming in Python, I've ran into a problem.
This line of code:
kickoff.write("rsyncbins\rsync --progress --recursive --delete --exclude rsyncbins/ --exclude etc/ --exclude logs/ --exclude screenshots/ --exclude uninstall.exe rsync://denver-1.download.toontownrewritten.com/ttr_win32/ .")
This goes into a batch file, but python thinks the \ and / are file paths and it screws everything up. How can I fix this?
Upvotes: 0
Views: 74
Reputation: 552
I think your problem is that you are introducing the \r special character in the string. The backslash is used to escape characters, so if you want to actually write "\r", you have two options:
rsyncbins\\rsync
kickoff.write(r"rsyncbins\rsync...")
There is no reason for python to be confused about slashes, don't worry!
Upvotes: 5