newbie question

1 jnlc at bellsouth.net
Wed Oct 31 11:55:49 EST 2001


ok to keep it simple.
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".

When I got to run the file (by typing python hello.py)i get this error
message:

>>> python hello.py
SyntaxError: invalid syntax
>>>

Is there anything that i missed or did wrong. This is just a simple little
example of a bigger problem.


"Steve Holden" <sholden at holdenweb.com> wrote in message
news:TBVD7.12967$0l4.499714 at atlpnn01.usenetserver.com...
> " 1" <jnlc at bellsouth.net> wrote ...
> > I must have missed it in the tutorial or some thing.
> >
> > I want to know how to open and run a file in python. The tutorial said
to
> > just type " python filename.py" and hit enter. I did this and it comes
> back
> > with an error message telling me the the file name is not defined. I
> wasn't
> > told that I had to define it first before I can run it. Is there an
easier
> > way to run files otherthan defining them?
> >
> OK. When asking for help, it's usually a good idea to give more rather
than
> less information, since you may not know what's going to be useful to the
> helper.
>
> In this case I am assuming that the file name that is "not defined" is
> python -- in other words, that when you type
>
>     python filename.py
>
> the system can't find the Python interpreter, rather than the system is
> running Python which then cannot find filename.py. If this is the case
then
> you are going to have to tell your command line interpreter (the Unix
shell,
> or the NT/W98/W95/W2k cmd.exe program) how to find Python. This will
involve
> modifying your "path setting".
>
> If this doesn't help you enough, perhaps you could let us see the exact
> error message, and tell us which OS you are using?
>
> regards
>  Steve
> --
> http://www.holdenweb.com/
>
>
>
>
>






More information about the Python-list mailing list