Command line and interactive interpreter (Was: Re: Python is easy?)

Jarno J Virtanen jajvirta at cc.helsinki.fi
Tue Aug 13 03:23:18 EDT 2002


12 Aug 2002 19:48:06 -0700 Jonathan Driller wrote:

> I keep getting this error using ActiveStates win2k install 2.2:
>>> test1.py
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
 NameError: name 'test1' is not defined

As others have pointed out, '>>>' denotes the prompt of the interactive
interpreter. You should give the script to the python interpreter in
the command line like for example 'E:\Python22> python test1.py'. 

This is not the first time I have seen someone bumbing into this
problem; problem that is, however, quite minor in the long run. Source
of this confusion seems quite obvious. Many tutorials describe the
process of running python programs by telling something like "run the
script in the command line" and the Windows menu of a Python
installation has an entry "Python (command line)". While this isn't a
huge issue, I personally think it should spell "Python (interactive
interpreter)". (I wonder if there was some specific reason for 
choosing such spelling.)



More information about the Python-list mailing list