[Tutor] random numbers

Jennifer Cianciolo jciancio@indiana.edu
Wed May 28 14:04:19 2003


oh yeah, 

I'm using python 2.2.2

-------------------
> 
> 
> On Wed, 28 May 2003, Jennifer Cianciolo wrote:
> 
> > I'm having trouble generating random numbers.
> >
> > if I do
> >
> > import random
> > random.random()
> >
> > I get
> >
> > TypeError: 'module' object is not callable
> 
> 
> Hello!
> 
> 
> Hmmm... we seem to be getting a whole slew of module importing
questions
> today...  *grin* I think we need more information; it sounds like
the
> 'random' that you're importing isn't the one from the Standard
Library.
> 
> 
> 
> Let's probe this: what's the name of your current source file?  Is
it
> called 'random.py', or is there a 'random.py' in your current
directory?
> If so, that's most likely the source of our problem.  If not, then
we'll
> have to think of something else.
> 
> 
> By the way, I've actually cooked up a small pseudomodule that tries
to
> alleviate a common module importing problem:
> 
>     http://hkn.eecs.berkeley.edu/~dyoo/python/__std__/
> 
> 
> 
> 
> Good luck to you!
> 
> 
> 
>