python version?

Peter Hansen peter at engcorp.com
Mon Jun 17 21:20:08 EDT 2002


George Hester wrote:
> 
> "Gerhard Häring" <gerhard at bigfoot.de> wrote:
> > You did not import the sys module.

> Probably not.  Where do I import that from and how do it?  I am trying to put a
> script in ASP using Python as the script language to give me the version of
> Python that I am running when I call the ASP.  The more the script works out of
> the box the better I'll be able to catch on to this language.  Thanks.

It sounds to me like you should probably crawl before you walk.
I suggest downloading the tutorial and installing Python on
your own machine and using it interactively from the prompt
before you advance to something like ASP scripting.  Your
responses clearly show you aren't ready to write code in an
environment which is doubtless going to mask from you many
of the errors and messages which you will encounter as you learn.

In the above case you would be able to experiment and learn about
these things:

C:\>python
Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
>>> sys.version
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'sys' is not defined

Here's where you would pause to learn a little more about Python....

>>> import sys
>>> sys.version
'2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)]'

-Peter



More information about the Python-list mailing list