newbie question
Steve Holden
sholden at holdenweb.com
Wed Oct 31 12:38:07 EST 2001
" 1" <jnlc at bellsouth.net> wrote in message
news:yXVD7.6251$QL2.175221 at e3500-atl1.usenetserver.com...
> ok to keep it simple.
Always a good idea.
> I am running win98se w/ python 2.1 installed. I have tried this in both
> python shell and in command line.
>
> Just to keep it simple I wrote a file called "hello.py". all that it
> contains is a print command (print" hello world!"). I saved the command in
> the python dir in my PC and named it "hello.py".
>
OK so far. When you say "the python dir in my PC", I presume you mean the
place where Python got installed. You don't need to put your programs there,
and as a general rule you shouldn't.
> When I got to run the file (by typing python hello.py)i get this error
> message:
>
> >>> python hello.py
> SyntaxError: invalid syntax
> >>>
>
Well, you already typed the command
python
to get the >>> prompt! Instead of typing that, try typing
python hello.py
or, if you haven't put yourself in the same directory as your program is
stored, maybe
python C:\dir\subdir\hello.py
> Is there anything that i missed or did wrong. This is just a simple little
> example of a bigger problem.
>
The instructions for using the interpreter have been know to cause
confusion, so I wouldn't worry. Just come back again if none of hte above
advice helps!
regards
Steve
--
http://www.holdenweb.com/
More information about the Python-list
mailing list