[Zope] Random # generator

Passin, Tom tpassin@mitretek.org
Fri, 23 May 2003 15:17:52 -0400

[ 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 =3D random.Random()
> return g

Gotta check the manual - it's


Also, you can just write this if you like (no need for the intermediate
variable) -

import random
return random.random()

Works fine for me!


Tom P