Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:58:57+00:00 2026-05-25T05:58:57+00:00

I am generating diagrams in Turtle, and as part of my program, I identify

  • 0

I am generating diagrams in Turtle, and as part of my program, I identify certain coordinates from my diagrams. I would like to be able to hide the complete turtle window, since I only care about the coordinates, is that possible?

Edit:

QUESTION 2:

This isn’t really an answer, but a few other questions.

I got my program working to some extent, if you run it in IDLE and type “l” it will give you the list with the coordinates.

import Tkinter
import turtle

from turtle import rt, lt, fd   # Right, Left, Forward

size = 10

root = Tkinter.Tk()
root.withdraw()

c = Tkinter.Canvas(master = root)
t = turtle.RawTurtle(c)

t.speed("Fastest")

# List entire coordinates
l = []

def findAndStoreCoords():
    x = t.xcor()
    y = t.ycor()

    x = round(x, 0)     # Round x to the nearest integer
    y = round(y, 0)     # Round y to the nearest integer

    # Integrate coordinates into sub-list
    l.append([x, y])

def hilbert(level, angle):
    if level == 0:
        return

    t.rt(angle)
    hilbert(level - 1, -angle)
    t.fd(size)
    findAndStoreCoords()
    t.lt(angle)
    hilbert(level - 1, angle)
    t.fd(size)
    findAndStoreCoords()
    hilbert(level - 1, angle)
    t.lt(angle)
    t.fd(size)
    findAndStoreCoords()
    hilbert(level - 1, -angle)
    t.rt(angle)

The problem is that Turtle is so SLOW! Is there any package that is just like Turtle but can do commands much faster?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:58:58+00:00Added an answer on May 25, 2026 at 5:58 am

    I reimplemented the turtle class as suggested by thirtyseven. It is consistent with the api. (i.e. when you turn right in this class, it is the same as turning right in turtle.

    This does not implement all the methods in the api, only common ones. (And the ones you used).

    However, it’s short and fairly straightforward to extend. Also, it keeps track of all of the points it has been to. It does this by adding an entry to pointsVisited every time you call forward, backward, or setpos (or any of the aliases for those functions).

    import math
    
    class UndrawnTurtle():
        def __init__(self):
            self.x, self.y, self.angle = 0.0, 0.0, 0.0
            self.pointsVisited = []
            self._visit()
    
        def position(self):
            return self.x, self.y
    
        def xcor(self):
            return self.x
    
        def ycor(self):
            return self.y
    
        def forward(self, distance):
            angle_radians = math.radians(self.angle)
    
            self.x += math.cos(angle_radians) * distance
            self.y += math.sin(angle_radians) * distance
    
            self._visit()
    
        def backward(self, distance):
            self.forward(-distance)
    
        def right(self, angle):
            self.angle -= angle
    
        def left(self, angle):
            self.angle += angle
    
        def setpos(self, x, y = None):
            """Can be passed either a tuple or two numbers."""
            if y == None:
                self.x = x[0]
                self.y = y[1]
            else:
                self.x = x
                self.y = y
            self._visit()
    
        def _visit(self):
            """Add point to the list of points gone to by the turtle."""
            self.pointsVisited.append(self.position())
    
        # Now for some aliases. Everything that's implemented in this class
        # should be aliased the same way as the actual api.
        fd = forward
        bk = backward
        back = backward
        rt = right
        lt = left
        setposition = setpos
        goto = setpos
        pos = position
    
    ut = UndrawnTurtle()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When generating VS2010 targets with CMake, I would like the /LTCG flag turned on
I am especially interested in generating code from sequence diagrams and vice versa- ie.,
Im generating a report from a template html file in my program. It resides
I'm searching a tool for generating UML-Diagrams by the import of SQL-Syntax-Files. I need
Am generating a hidden fields like so: @helper.input(_form(userID), '_label-> None) { (id, name, value,
When generating models from postgresql with ColdFusion Illudium Code generator the boolean values get
I'm generating json from a Rails app, and am filtering fields using the format.json
I am generating Database diagram from Sql server 2005 Professional edition. Clinet is coming
Generating a scaffold like this: rails generate scaffold User name:string email:string creates bits of
I have the requirement of generating UML Diagrams for one of my C++ assignments.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.