Install Python in C:\usr\bin

Erik Max Francis max at alcyone.com
Sun Jan 19 21:35:41 EST 2003


Will Stuyvesant wrote:

> And here is some more "using Python for CGI" adventures:
> "Segmentation fault" when running CGI scripts remotely (host has
> Python 1.5).

Works for me:

#!/usr/local/bin/python1.5

import random
import sys

print "Context-type: text/plain"
print

print hex(sys.hexversion)
print random.random()

prints:

0x10502f0
0.987676482342

Are you sure the crash is happening when you import random?

> After some testing it turned out I could not do "import random" in my
> CGI scripts.  Solved it by replacing ``random`` with ``whrandom`` in
> every script.  I read the modules' specs a bit but I still don't get
> it...there must be an important difference between ``random`` and
> ``whrandom``.  Why else would we have 2 random modules.  The reason
> must be important.  Um.  Is it?

whrandom is the deprecated version.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Yes I'm / Learning from falling down / Heavily
\__/ Lamya
    Fauxident / http://www.alcyone.com/pyos/fauxident/
 A "faux" ident daemon in Python.




More information about the Python-list mailing list