New guy question
sheila at spamcop.net
Sun Jun 10 16:24:50 CEST 2001
On Sun, 10 Jun 2001 13:04:35 GMT, "Glen Mettler" <Glen.Mettler at home.com>
wrote in comp.lang.python in article
<DfKU6.130092$I5.33794657 at news1.rdc1.tn.home.com>:
:OK...I went back to the beginning and discovered that the author of the
:tutorial showed me three windows.
:One with a black background that he described as the Python prompt (>>>)
:(title is Python)
:One with a white background that he described as IDLE - also with a Python
:prompt (title is Python Shell)
:One with a black background that he described as the "command" window that
:in fact is the DOS window (title MS DOS Prompt)
:I went to the MS DOS Prompt ("Command") and typed in python alook.py and got
:an error message: Bad command or file name.
This sounds like Python is not in the PATH for your computer. (When it
says, "Bad command or file name" it is basically telling you that it
doesn't understand how to execute the command that you gave it. The
reason it doesn't understand, is because it doesn't know where your
"python" executable is.)
You can fix it this way:
Go to the Start Menu. Click on "Run".
Under "Run" a little dialog box should pop up with a little box to type
in the name of something.
and click on "OK".
When it pops up a window, choose the tab that says "Autoexec.bat".
Somewhere in there you need to add a statement. So pick the button that
SET PATH = C:\Python\Python20;%PATH%
except that instead of C:\Python\Python20
you need to put the path to Python on YOUR COMPUTER.
I would also use the Move Down button and put this lower in the list of
commands to your Autoexec.bat file.
Reboot your machine and then try bringing up a DOS window and typing
at the DOS prompt. Hopefully it should work now.
:"Glen Mettler" <Glen.Mettler at home.com> wrote in message
:news:TiyU6.127784$I5.32725119 at news1.rdc1.tn.home.com...
:> I have a small script I entered from a Python book that works when I run
:> using F5.
:> However, when I go to the console and enter python alook.py, I get an
:> message: >
:> >>> python alook.py
:> SyntaxError: invalid syntax
:> I am too new to this to know why.
More information about the Python-list