I have a program that creates another program on the user's computer. In a snippet, I define the directory to which the new program will be destined as
diret = "C:\Users\" + d_user
where d_user is the rest of the directory. However when it is created and executed, the string is converted to
'C:\Users\'
with a bar only, which raises
SyntaxError: EOL while scanning string literal
because the string is not closed in the second ['].
How can I prevent this from occurring in order for my code to be fully executed?
EDIT:
The code within the master code, which will be created, is available at link from lines 4 through 24; the rest are just the context of the main code. The error happens with line 10.