1
I have a program that creates for your running another program on the user’s computer. In a snippet, I define the directory to which the new program will be intended as
diret = "C:\\Users\\" + d_user
where d_user is the rest of the directory. However, when created and executed, the string is converted to
'C:\Users\'
with only one bar, which raises
SyntaxError: EOL while scanning string literal
because the string is not closed in the second ['].
How can I prevent this from happening in order for my code to be fully executed?
EDIT:
The code within the main code, which will be created, is available at https://ideone.com/KTAQxf lines 4 to 24; the others are only the context of the main code. The error occurs with line 10.
Can you give a full example that fails? I can’t reproduce the error.
– Pedro von Hertwig Batista
@Pedrovonhertwig I updated, thank you in advance for any help.
– user93774