Python Forum
SyntaxError when trying to execute code on Windows - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: SyntaxError when trying to execute code on Windows (/thread-26247.html)



SyntaxError when trying to execute code on Windows - Fred0n - Apr-25-2020

I'm a brand new baby when it comes to programming. just want to run simple hello world doc from a different directory in Windows native Dos

Error:
SyntaxError: unexpected character after line continuation character >>> Users\fredt\OneDrive\Documents\ hello.py File "<stdin>", line 1 Users\fredt\OneDrive\Documents\hello.py
^

its simple I know I'm starting to feel like if I were to catch fire I'd burn really slowly..PLZ HELP


RE: Basic Basic Basic - ndc85430 - Apr-25-2020

It looks like you're trying to run that from inside the Python shell. That's wrong. At the Windows prompt, you should be running python <path to script>.


RE: Basic Basic Basic - buran - Apr-25-2020

have a look at https://python-forum.io/Thread-How-to-Execute-python-code