[Tutor] Random module error

Guess?!? wtfwhoami at gmail.com
Thu May 15 21:48:33 CEST 2008


Hello Kent,

I dont have any program with name random.py. I am using swampy API (
http://allendowney.com/swampy/install.html)
As instructed by author, I do following steps

1> unzip/extract the folder into Python directory
2> go to the swampy directory
3> and invoke python command to start interpreter
4> as soon as I write from TurtleWorld import *

I get that error ..... I checked inside the folder ...there is no random.py
and
i checked TurtleWorld.py ....there is only reference to standard module
"random"

Thnks
G





On Thu, May 15, 2008 at 5:00 AM, Kent Johnson <kent37 at tds.net> wrote:

> On Thu, May 15, 2008 at 3:00 AM, Guess?!? <wtfwhoami at gmail.com> wrote:
> > Hello All,
> >
> > I am importing module "random" and it is giving me this error
> > below  AttributeError: 'module' object has no attribute 'randrange'
>
> You have named your program random.py. The import finds your program
> rather than the random module. Rename your program and delete the
> associated .pyc file and it will work.
>
> Kent
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080515/8a192814/attachment.htm>


More information about the Tutor mailing list