0

I am very very new to Python. I am trying to get a python program to run by writing 'python hello.py' but every time I do that I get a Syntax Error. Why is that?

However when I open the file and click on run module, it works. Why won't it work if I type 'python hello.py'

Is there anyway I can navigate to the directory where the file is stored and then run it? I tried placing my file in directly in the Python23 folder :P didnt work anyway

Please help me. I have Python 2.3.5

2 Answers 2

2

I'm guessing that you're running python hello.py within the Python REPL. This won't work; python hello.py is something that starts Python that you'll need to run in your system shell.

Sign up to request clarification or add additional context in comments.

Comments

0

What is the error?

Place python's filepath to the python.exe in your system's PATH, then you can run a python file from anywhere.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.