Thread: Command Line
View Single Post
Old Aug 20th, 2004, 1:47 AM   #4
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 708
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Quote:
Originally posted by Insomniac@Aug 20 2004, 02:39 AM
Error message after typing : python hello.py

File "<stdin>", line 1
python hello.py
^ - (directly under the o)
SyntaxError: invalid syntax
That's the python interpreter, not you're command window. To run the program you need to use the command window.

To open a command window, click start, RUN and type CMD.exe

When that window comes change your directory to whevrever you save your python files (default is the python directory).

To change your directoy from inside the command window type


cd C:\Python23 (or whatever directory your script might be saved in)

and then type

python script.py


Make sure to try that from inside the command window and not the Python interpreter.
thechristelegacy is offline   Reply With Quote