RE: creating an instance of a random number generator

Hammond, Mark (MHammond@jm.cmutual.com.au)
Fri, 07 Apr 95 14:54:00 PDT

> I am thinking that saying
> import whrandom
> wh = whrandom(seed1, seed2, seed3)
> should give me an instance of a random-number generator; I could then
> use it by saying
> rand = wh.random()
>
> Python disagrees; it claims that "wh = whrandom(seed1, seed2, seed3)"
> is a "call of a non-function".

whrandom is a _module_, not a class. What you want is:

import whrandom
whrandom.seed(seed1, seed2, seed3)
rand = whrandom.random()

Unfortunately, this does not help your thread problem. AFAIK, there is no
way to have multiple random number classes, each with their own set of
seeds, etc.

Mark.