[Tutor] Fwd: : Turtle

Alan Gauld alan.gauld at yahoo.co.uk
Thu Jun 23 19:44:15 EDT 2016


On 23/06/16 22:13, Hershel Millman wrote:
> What I typed was:
> 
> import turtle
> turtle.pendown()
> 
> (And pendown was highlighted in pycharm, indicating that it was not a valid command.)

Don't use pycharm. We need to eliminate as many variables as possible.
Start python in a Terminal and just type the commands into the raw
Python interpreter. Send a paste of the transcript.
I expect to see something like:

agauld at ubuntu:~$ python2
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import turtle
>>> turtle.__file__
'/usr/lib/python2.7/lib-tk/turtle.pyc'
>>> turtle.pendown
<function pendown at 0x7f804ecd1320>
>>> turtle.pendown()
>>>

Can you reproduce that on your Mac? (Except maybe with an
error message somewhere along the line?)

> /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 "/Users/Hershel/PycharmProjects/Project 1/practicefornotturtle.py"
> Traceback (most recent call last):
>   File "/Users/Hershel/PycharmProjects/Project 1/practicefornotturtle.py", line 2, in <module>
>     turtle.pendown()
> AttributeError: 'module' object has no attribute 'pendown'

I notice that this says you are using Python 2.5 but your
last message suggested the module was in 2.6.

I don't think that should make a difference for the turtle
module but it might be significant... Lets see your
transcript first.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list