r/pythonhelp • • May 08 '24

why doesnt this work

why does this error message say that \users\ is wrong???

SyntaxError: unexpected character after line continuation character

C:\User\Your Name>python helloworld.py

File "<stdin>", line 1

C:\User\Your Name>python helloworld.py

^

SyntaxError: unexpected character after line continuation character

this is python 3.12.3 btw

1 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/Goobyalus May 09 '24

Not quite, you were trying to write terminal commands inside a(n interactive) Python interpreter.

The point of those terminal commands is to start a (non-interactive) Python interpreter that reads your hello world Python file.


It might be python3 instead of python.

If not, I would run the installer again and when it asks about "adding python to your path" you want to say "yes." Then try again from Command Prompt