Python Forum
Turtle / turtle question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turtle / turtle question
#2
If you do import turtle as t, then t is the turtle module. If you do import turtle; t = turtle.Turtle(), then t is an instance of the turtle.Turtle class. The module and the class have different members.

Things are somewhat complicated by the fact that the turtle module implements a procedure-oriented interface (without explicit creation of a Turtle instance) and an object-oriented interface. If you want to be consistent with the rest of python, choose the the object-oriented interface, that is to say, create your own Turtle instance and work with it (that's where you say that you can do anything you want).
Reply


Messages In This Thread
Turtle / turtle question - by DPaul - Oct-04-2020, 08:30 AM
RE: Turtle / turtle question - by Gribouillis - Oct-04-2020, 08:48 AM
RE: Turtle / turtle question - by DPaul - Oct-04-2020, 09:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Turtle. Pointers of the "arrow" direction of the vector. roomONmoon 1 619 Dec-09-2023, 11:49 PM
Last Post: deanhystad
  Module: Turtle issues Underscore 4 2,544 Sep-24-2021, 04:28 PM
Last Post: Underscore
  [Tkinter] Tkinter/turtle doevents DPaul 0 1,792 Sep-24-2020, 07:59 AM
Last Post: DPaul
  [Turtle] numinput and textinput do not work fgarciamoran 1 3,116 Apr-28-2020, 08:44 PM
Last Post: deanhystad
  Turtle fillcolor? bobgardner 2 1,820 Apr-12-2020, 07:13 PM
Last Post: bobgardner
  [Tkinter] Tkinter/Turtle Stopping and Starting Timers Cleanly robin73 2 3,302 Apr-01-2020, 07:31 AM
Last Post: robin73
  tkinter window and turtle window error 1885 3 6,620 Nov-02-2019, 12:18 PM
Last Post: 1885
  [Turtle]Need help with moving a square on key press GalaxyCoyote 2 2,903 May-18-2019, 05:31 PM
Last Post: Yoriz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020