Random module missing?
Brown, Rodrick
rodrick.brown at citi.com
Wed Sep 23 17:14:49 EDT 2009
More information about the Python-list mailing list
Wed Sep 23 17:14:49 EDT 2009
- Previous message (by thread): Random module missing?
- Next message (by thread): Random module missing?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks Jerry that was the problem. -----Original Message----- From: python-list-bounces+rodrick.brown=citi.com at python.org [mailto:python-list-bounces+rodrick.brown=citi.com at python.org] On Behalf Of Jerry Hill Sent: Wednesday, September 23, 2009 5:11 PM To: python-list at python.org Subject: Re: Random module missing? On Wed, Sep 23, 2009 at 5:00 PM, Brown, Rodrick <rodrick.brown at citi.com> wrote: > I seen some documentation about random.random() but my version seems to be broken? > > Python 2.3.4 (#1, Jul 16 2009, 07:03:37) [GCC 3.4.6 20060404 (Red Hat > 3.4.6-11)] on linux2 Type "help", "copyright", "credits" or "license" > for more information. >>>> import random >>>> dir(random) > ['__builtins__', '__doc__', '__file__', '__name__'] >>>> random.random() > Traceback (most recent call last): > File "<stdin>", line 1, in ? > AttributeError: 'module' object has no attribute 'rand > > Please advise thanks. You have a file named random.py (and/or random.pyc) that is shadowing the built in module. Rename it. if you have trouble finding it, you can do the following: import random print random.__file__ -- Jerry -- http://mail.python.org/mailman/listinfo/python-list
- Previous message (by thread): Random module missing?
- Next message (by thread): Random module missing?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list