none
Turtle module for python RRS feed

  • Question

  • Hey,
    I am trying to import the turtle module in VS:

    import turtle # here I got this error (raceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File ".\turtle.py", line 2, in <module>
        turtle.forward(30)
    NameError: name 'turtle' is not defined)
    So i can't keep going with the next function calls
     s = turtle.Screen()    
     a = turtle.Turtle()

     a.forward(50)
     a.left(90)
     a.forward(30)

     s.mainloop()
    Thursday, May 23, 2019 8:42 AM

Answers

  • Hi Joseph,

    Welcome to the MSDN forum.

    According to your description, this issue is about the VS Python development and our forum is to discuss the VS IDE, please redirect to this appropriate forum: https://github.com/microsoft/PTVS/issues for better support, thanks for your understanding.

    Maybe you can have a try with the following:

    from turtle import *

    bob = Turtle()

    If I make any misunderstanding, please feel free to let me know, sorry for this inconvenience.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by JosephAZ Friday, May 24, 2019 9:00 AM
    Friday, May 24, 2019 8:09 AM
    Moderator