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

icktoofay
  • 126,289
  • 21
  • 250
  • 231
Saturnian
  • 1,686
  • 6
  • 39
  • 65

2 Answers2

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.

icktoofay
  • 126,289
  • 21
  • 250
  • 231
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.

ninMonkey
  • 7,211
  • 8
  • 37
  • 66