Is there a way to prevent Python from recognizing escape characters?
Question:
Code:
import os
filename = "cp.lnk"
lnk = "shortcutscmd_shortcuts" + filename
os.system(lnk)
And that gives me this error, I’m assuming, because it recognizes escape quotes in the variable:
‘shortcuts’ is not recognized as an internal or external command,
operable program or batch file.
I then tried:
import os
filename = "cp.lnk"
lnk = r"shortcutscmd_shortcuts" + filename
os.system(lnk)
It game me the same error. How can I fix this?
Thank you!
Edit: Sorry my question was so bad ):
Answers:
Pretty sure that should fix it but don’t quote me on that.
import os
filename = "cp.lnk"
lnk = r"shortcuts\cmd_shortcuts\" + filename
os.system(lnk)
import os
filename = "cp.lnk"
lnk = "shortcuts\cmd_shortcuts\" + filename
os.system(lnk)
Code:
import os
filename = "cp.lnk"
lnk = "shortcutscmd_shortcuts" + filename
os.system(lnk)
And that gives me this error, I’m assuming, because it recognizes escape quotes in the variable:
‘shortcuts’ is not recognized as an internal or external command,
operable program or batch file.
I then tried:
import os
filename = "cp.lnk"
lnk = r"shortcutscmd_shortcuts" + filename
os.system(lnk)
It game me the same error. How can I fix this?
Thank you!
Edit: Sorry my question was so bad ):
Pretty sure that should fix it but don’t quote me on that.
import os
filename = "cp.lnk"
lnk = r"shortcuts\cmd_shortcuts\" + filename
os.system(lnk)
import os
filename = "cp.lnk"
lnk = "shortcuts\cmd_shortcuts\" + filename
os.system(lnk)