Running python on windows.

Bengt Richter bokr at oz.net
Tue Nov 12 03:02:15 EST 2002


On 11 Nov 2002 21:21:04 -0800, kishoreb8 at hotmail.com (kk) wrote:

>Hi 
> I am new to python, tried to run python at >>> prompt its giving
>syntax error.Any one help me to run python scripts on windows.
>
If you have the >>> prompt, python is already running ;-)

In other words, it's ready to interpret statements and expressions
that you may type in. E.g.,

 >>> 2*3
 6
 >>> 2+3
 5
 >>> '2' + '3'
 '23'
 >>> '2' * 3
 '222'
 >>> for i in range(10):
 ...     print i, 2**i
 ...
 0 1
 1 2
 2 4
 3 8
 4 16
 5 32
 6 64
 7 128
 8 256
 9 512

but if you type "python" the way you would to start python
in a DOS console window when you already have the python >>> prompt,
you get this:

 >>> python
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 NameError: name 'python' is not defined

There are lots of helpful people here willing to help, but you have
to do your part. That means try to give all the information necessary
to understand your problem. The best way is to copy from the interactive
test you did and paste it into your newsgroup post. If you had done that
this time, we would know what the syntax error was that you are talking
about, and would be able to help better.

Reading the tutorial at

    http://www.python.org/doc/current/tut/tut.html

is a must. You will soon find the basics easy and you'll
find solving problems with Python is fun instead of tiresome ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list