[Tutor] serious problem with graphics module

Gregor Lingl gregor.lingl at aon.at
Tue May 26 00:33:21 CEST 2009



bob gailer schrieb:
> roberto wrote:
>> hello everyone
>> i have a problem with python 3.0 graphics module:
>>
>> no problem while importing the module
>>  
>>>>> import turtle
>>>>>         
>>
>> but when i issue any command like:
>>  
>>>>> t = turtle.pen()
>>>>> t = turtle.forward(60)
>>>>>         
>
> Your code fails for me at turtle.pen AttributeError: 'module' object 
> has no attribute 'pen'
Do you use Python 3.0?

 >>> import turtle
 >>> turtle.pen
<function pen at 0x0179A4F8>
 >>>

> If I replace pen with Pen then it works as desired.
Then you use the Pen-class to create a Turtle t. Then you
have to call the forward method for this turtle:

 >>> import turtle
 >>> t = turtle.Pen()
 >>> t.forward(60)
 >>>

Regards,
Gregor

>


More information about the Tutor mailing list