Running python scripts from the command line.

Nanderson mandersonrandersonanderson at gmail.com
Tue Feb 1 03:43:25 CET 2011


I've recently started to program. Python is my first language, so I'm
a complete beginner. I've been trying to call python scripts from the
command line by entering this command into it:

>>>python test.py

But it gives me this error message:

>>>python test.py
  File "<stdin>", line 1
    python test.py
                   ^
SyntaxError: invalid syntax

I know that test.py exists, and the script is correct (here is is
anyways):

a = 1
if a:
    print 'Value of a is', a

I am using python 2.7.1 installed on Windows 7. This seems like
something that should be easy, so I'm sure I'm just missing a very
small problem. Any help is greatly appreciated.

Thanks,
Anderson



More information about the Python-list mailing list