n/m I'm stupid. import random g = random.random() return g or simply import random return random.random() Both work. Thanks! -----Original Message----- From: Passin, Tom [mailto:tpassin@mitretek.org] Sent: Friday, May 23, 2003 2:18 PM To: zope@zope.org Subject: RE: [Zope] Random # generator [ John Toews]
I know this is a stupid question, I'm feeling quite inept as a programmer right now, but I cannot figure out how to generate a random
number. I've tried a few different methods but can't seem to get any good result.
Code (Python script):
import random g = random.Random() return g
Gotta check the manual - it's random.random() Also, you can just write this if you like (no need for the intermediate variable) - import random return random.random() Works fine for me! Cheers, Tom P _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )