You need either to escape backslashes or prepend the path string with
backslash is an escape character in Python string, so the way you wrote it each character after backslash is interpreted differently.
PS same goes for
PPS Posting exception message next time may be a good idea
r
prefix to force its interpretation as a raw stringr'C:\Program Files (x86)\XYplorer\XYplorer.exe'
backslash is an escape character in Python string, so the way you wrote it each character after backslash is interpreted differently.
PS same goes for
myfile
(with heading @buran's advice re uncommenting).PPS Posting exception message next time may be a good idea
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.