Newbie question

Charlie Clark charlie at begeistert.org
Mon May 28 10:08:26 EDT 2001


>>>> python 1.py
>   File "<stdin>", line 1
>     python 1.py
>             ^
> SyntaxError: invalid syntax
>>>>
>
> Clearly I'm doing something wrong but what?
>
You have started the interactive prompt - which is where you can test
bits of code on the fly. You don't need to do this if you just want to
run a program. You just put the program name after python like "python
1.py" if you're in windows or simply "1.py" if you're working in another
operating system.

You might want to try using IDLE for all this as Windows is not really a
nice place to use a command line interpreter. IDLE allows you run
programs you've written and helps manage the ones you have open. It
should have been installed when you installed Python.

Should you want to call the program you've written while you're working
in the interactive prompt you would use import. >>>"import 1.py" or
"from 1.py import ..."

Charlie



More information about the Python-list mailing list