[docs] Python error

Petr Viktorin encukou at gmail.com
Wed Jul 29 15:23:27 CEST 2015


Hello Ryan,
Rename your file to something other than "turtle.py".

The "import" statement is loading the file you wrote instead of
Python's turtle library.

On Tue, Jul 28, 2015 at 3:42 AM, Ryan Matenga
<rmatenga at mybce.catholic.edu.au> wrote:
> Hi
>
> Could you help me please.  I am using Python 3.4.3 and I keep getting an
> error when I try to run my code.
>
> My class mates are using the same code and version as me and they are not
> getting the error.
>
> Thanks
> Ryan
>
> from turtle import*
> shape("turtle")
> speed(10)
>
> forward(100)
> right(90)
> forward(100)
>
> done()
> Traceback (most recent call last):
>   File "/Users/rmatenga/Desktop/LineDrawing.py", line 1, in <module>
>     from turtle import*
>   File "/Users/rmatenga/Desktop/turtle.py", line 2, in <module>
>     shape("turtle")
> NameError: name 'shape' is not defined
>>>>
>
> _______________________________________________
> docs mailing list
> docs at python.org
> https://mail.python.org/mailman/listinfo/docs
>


More information about the docs mailing list