Questions tagged [python-turtle]

The python turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways.

507 questions
2
votes
1 answer

How to show two different photos as turtles?

I'm trying to import two different pictures and show them in a line using Turtle (when I'll manage to do so they are supposed to move) but I can't find a way to show them together, the last picture I assigned to the turtle and the screen is taking…
2
votes
5 answers

How to move multiple turtles in a for loop?

So, I am a recent beginner to python and for my class I am being tasked with making a turtle race with 10 turtles that all move and should stop at the finish line. I was given directions to make a list for the turtles and have a while loop to make…
2
votes
1 answer

Using Turtle module in Python to move shrinking turtle up window screen

I am supposed to define a function, movingTurtle, that uses the Python turtle module, sets the turtle to an actual turtle shape, and moves that turtle up from the bottom of the screen towards the top, getting smaller as it moves along. Here is the…
2
votes
2 answers

Drawing a complete graph of equally-spaced points on a circle's circumference with Turtle

I'm writing a function that dots equally-spaced points on the circumference of a circle centered at origin, then draws lines between all points. I have been messing with this code for a while now and I can not seem to get it to function as intended.…
2
votes
2 answers

turtle() does not rotate multiple balls plus attribute error

I would like to create balls going around in a circle with different radiuses, similar to the solar system. In my attempt, the algorithm should create balls -initialize them to locations of radius , then start spinning at the same time, in my…
quadhd
  • 59
  • 7
2
votes
3 answers

How to draw a clock on python?(one that doesn't have hour hand or minute hand, just a diagram)

I tried to create a picture of a clock face with python 3 turtle, but the numbers aren't correctly aligned. A little help? Thanks! This is what i have so far: import turtle screen=turtle.Screen() screen.bgcolor(135, 205, 250) clock =…
2
votes
1 answer

python turtle Name error: shape is not defined

When I tried in Mac os with python 3.8.3 this code: from turtle import * shape("turtle") I get this error: Traceback (most recent call last): File "C:\Users\jeeva\Desktop\Tanmay_new\python\pi\Draw_pi\draw_pi.pyw", line 2, in
math
  • 240
  • 2
  • 15
2
votes
3 answers

Draw Triangle by turtle

I am a beginner to python and found a code to draw triangle by Turtle as below code def drawPolygon(t, vertices): t.up() (x, y) = vertices[-1] t.goto(x, y) t.down() for (x, y) in vertices: t.goto(x, y) import turtle t =…
Pipo
  • 199
  • 3
  • 20
2
votes
1 answer

Python simple score (point) system on a simple game

I have produced a simple game using the turtle module. The objective of the game is to return to the original position in a certain number of moves, through left and right inputs. Therefore, I tried to make a scoring (point) system that counts the…
Amziino
  • 25
  • 6
2
votes
1 answer

How can you make two or more turtles perform a task at the same time?

My goal for this program was to get used to python's built-in "turtle" method. My goal was to program four (ninja) turtles to walk simultaneously in a square. While there were no absolute errors in my program, I wanted the program to show turtles…
Leonardo
  • 312
  • 2
  • 12
2
votes
1 answer

turtle onkeypress() does not respond

I am creating a game, but when I press the Up or Down arrow keys, nothing happens. Instead of moving when I press those keys, the turtles have already moved when I run the code. Here is the code: turtle_race.py: from turtle import Screen import…
nishant
  • 23
  • 4
2
votes
6 answers

How do I draw this shape in Turtle?

I got a challenge in a learning group today to draw this shape in python turtle library. I cannot figure out a way to express the geometrical solution to find the angles to turn and the size of the line I need. Can you please tell me how to draw…
Tes
  • 45
  • 3
2
votes
2 answers

How to speed up the turtle while in a tkinter canvas

I'm trying to make the turtle move faster, which I would normally do using import turtle as t t.speed(0) t.tracer(0,0) But when I have it in a canvas using RawTurtle(), I'm not sure how to do this. root = tk.Tk() #create root window #create…
help
  • 65
  • 5
2
votes
1 answer

Stop the `extent` argument in Turtle from changing direction of circle

I am working on a homework assignment where the instructions are: Using Turtle graphics, implement function planets(), which will simulate the planetary motion of Mercury, Venus, Earth, and Mars during one rotation of planet Mars. You can assume…
2
votes
2 answers

How do I change the color of the turtle, not the pen?

How do you change what color the turtle looks, not the pen? I want the turtle to draw white on the screen, but if I change the color to 'white' I can't see the turtle anymore. Is there something like turtle.turtlecolor or something?
1 2
3
33 34