This is one of my lines in a script I'm trying to make in Python:
src = r"C:\Users\Aydan\Desktop\SortedImages\" + text_file_name + "\\" + file_name
As you can see, I'm trying to concatenate a file destination together with folder names stored in a variable and a file name stored in another variable.
When debugging, I'm getting an error with the syntax:
SyntaxError: unexpected character after line continuation character
I'm assuming it's the backslash, but I've escaped it so I'm not too sure what to do. Other than the backslash, I have no idea what this error is pointing at.
Whole code:
import shutil
import glob
dst = r"C:/Users/Aydan/Desktop/1855"
for filename in glob.glob(r"C:\Users\Aydan\Desktop\RTHPython\Years\*.txt"):
text_file_name = filename.strip()
with open (text_file_name) as my_file:
for filename in my_file:
file_name = filename.strip()
src = r"C:\Users\Aydan\Desktop\SortedImages\" + text_file_name + "\\" + file_name
shutil.move(src, dst)