Newbie question

David Stanek nospam_davidstanek at hotmail.com
Mon May 21 09:05:09 EDT 2001


Patrick,
>From the commandline type python 1.py, not after you run the interpreter.
With Python and many other scripting languages you can execute code in two
modes.  What you are looking for is invoking the interpreter on a file i.e.
the "python 1.py".  The other mode in interactive, which means that you only
type "python" and then enter your commands.
e.g.
C:\>python
>>>print "hello Python"
hello Python
>>>

David Stanek
"Patrick Kirk" <pknews at kirks.net> wrote in message
news:9eb2mf$csj$1 at newsg3.svr.pol.co.uk...
> Hi all,
>
> I have read that Python is a good first language so I downloaded it and am
> wading through a tutorial.  But I'm having silly problems that I can't
work
> out.
>
> I run Win2k.  Python is in a folder called d:\python.  also in there is a
> file called 1.py
>
> At the command prpmpt, I cd to d:\python run python and enter python 1.py.
> Error message is:
>
> >>> python 1.py
>   File "<stdin>", line 1
>     python 1.py
>             ^
> SyntaxError: invalid syntax
> >>>
>
> Clearly I'm doing something wrong but what?
>
> All help appreciated!
>
> --
> --
> Patrick Kirk
> GSM: +44 7712 184 480
> ICQ: 42219699
>
> Wise Chinese Proverb:  "If tired of computer winning at real time strategy
> games, try it at kick-boxing instead"
>
>





More information about the Python-list mailing list