Sign in to follow this  
X Jado X

[Python] TurtleWorld Help

Recommended Posts

I got TurtleWorld, for one of the things in the book called "thinking like a computer scientist". I downloaded it, and extracted it into my Lib folder. I can import it and all that, but when I type bob = Turtle() it opens, and has a red turtle in the middle, I press it and it just freezes with a white screen and says 'TurtleWorld (Not Responding). Help please?

Share this post


Link to post
Share on other sites
Quote:
Original post by X Jado X
but when I type bob = Turtle()


Type it where? Some graphical APIs don't play nice with IDLE. (I've even had problems in IDLE with Tkinter stuff, which is part of the standard library.) You might try plain old 'python' at the command line if that's it.

Share this post


Link to post
Share on other sites
Clearly you are not following the instructions. I did a Google search and this was the second result; scroll down the page and you'll see the Turtle examples - and you'll see that the proper way to call the Turtle constructor is:
bob = Turtle(world)


By not passing in the world parameter (and I don't know what type of object it is; you're the one reading the book), you cause the Turtle instance to behave inappropriately. It's disappointing that there isn't error checking for this sort of thing, but it's also understanding since this is an instructional program and should have been run exactly as intended to illustrate various concepts.

Re-read the chapter and follow the code exactly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this