New guy question

D-Man dsh8290 at rit.edu
Sat Jun 9 22:03:37 EDT 2001


On Sat, Jun 09, 2001 at 11:28:51PM +0000, Glen Mettler wrote:
| I have a small script I entered from a Python book that works when I run it
| using F5.
| However, when I go to the console and enter python alook.py, I get an error
| message:
| 
| >>> python alook.py
| SyntaxError: invalid syntax
| 
| I am too new to this to know why.

As Alex indicated, it is not a problem with understanding python.  I
have seen that "new" Wintel-PC users often don't know what a shell is.
A "shell" is a prompt provided by the OS to enter commands.  On
"Wintel" boxes it used to be called DOS.  Now it is either called
"MS-DOS Prompt" or "Command Prompt" and can be found under the Start
menu.  On a Unix system their are many different shells, and the shell
is the first thing you will learn.  A shell is where you would type
things like "cd" "copy" "del", etc.  There you can type "python
alook.py" (assuming alook.py is in the current directory) to run the
program.  The prompt (for a DOS shell) is "C:\>" or something similar.

You have the "Python Interactive Interpreter" there, indicated by the
">>>" prompt.  In this shell-like window you can enter python
statements only.  No OS commands are allowed because they aren't
python code.

If you have any more questions re shells and DOS/Windows feel free to
ask.  You may also be interested in the "Tutor" list,
tutor at python.org.

HTH,
-D





More information about the Python-list mailing list