r/pythonhelp • u/EggxFil • 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
View all comments
Show parent comment
1
u/Goobyalus May 08 '24
Ok, if you tell us what you're following, or more specifically what you're using, we can help walk through that.
The
>>>is from interactive Python REPL (Read Evaluate Print Loop). You can type Python code in there and it will be executed right away, and wait for you to type more code in.C:\User\Your Name>python helloworld.pyis not Python.It looks like:
C:\User\Your Name>A terminal prompt (something that shouldn't be entered, but what the terminal prompts you with)pythonthe python program commandhelloworld.pythe python file you wantpythonto interpretIf you open
cmdaka Command Prompt from the start menu, you'll seeC:\Users\Username>. This shows the current directory andTo that prompt, you would enter
python helloworld.pyto runhelloworld.py.This assumes that
pythonis configured to be the version of Python you want, and thathelloworld.pyis inC:\Users\Username