#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0

    Unable to get the Python turtle to work


    I am very new to Python and i am working through Python for kids just published.
    I am running windows 8 and when i type in to Python shell to activate the Turtle window it appears behind the python shell window which displays the following message.
    "Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    >>> import turtle
    >>> t=turtle.pen()
    >>> t.forward(50)
    Traceback (most recent call last):
    File "<pyshell#2>", line 1, in <module>
    t.forward(50)
    AttributeError: 'dict' object has no attribute 'forward'
    >>>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Probable solution


    I think this is what they meant to print:

    >>> import turtle
    >>> turtle.pen()
    >>> t = turtle
    >>> t.forward(50)

    I have the same book and the problem appears on the web as early as 2009.
    I contacted the authors and am waiting to find out what they really meant.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0
    Hi

    You've probably worked it out by now but
    >>> t=turtle.pen() should have upper case P as follows
    >>> t=turtle.Pen()

    Cheers

IMN logo majestic logo threadwatch logo seochat tools logo