python-turtle

Drawing a letter using circles in python turtle

Drawing a letter using circles in python turtle Question: I’d like to draw two letters using circles in turtle module. I would like to get such a result, but with the letters "T" and "S". How can this be done? Asked By: Çölden Kaktüs Çalan Bedevi || Source Answers: I have the code here: from …

Total answers: 1

how do i name turtles after a loops index and use them afterwards

how do i name turtles after a loops index and use them afterwards Question: i am trying to make a game using images as sprites where the 10 rocks papers and scissors float about killing each other tryign to make all of them one character but i want to make the turtles easily using an …

Total answers: 1

Draw polygon in polygons (regular polygons)

Draw polygon in polygons (regular polygons) Question: This is my code that draws regular polygons: import turtle tr = turtle.Turtle() tr.lt(150) for x in range(3,13): for i in range(x): tr.fd(80) tr.lt(360//x) turtle.done() This is my output: But my expected output is: Can you help me? Asked By: Roham || Source Answers: As already pointed in …

Total answers: 2

How to convert window coords into turtle coords (Python Turtle)

How to convert window coords into turtle coords (Python Turtle) Question: I am trying to create a program to move the turtle to where the mouse is. I am doing: import turtle t = turtle.Turtle() canvas = turtle.getcanvas() while True: mouseX, mouseY = canvas.winfo_pointerxy() t.goto(mouseX, mouseY) but the turtle keeps moving off the screen. I …

Total answers: 3

Python Turtle: How to do onkeypress to a function in another file

Python Turtle: How to do onkeypress to a function in another file Question: I have this issue in python turtle that when I attempt to do the onkeypress feature for a function that is in another file, nothing occurs. No error messages, no character movement. Nothing. File 1 (Player Function and Creating Sprite): class Player: …

Total answers: 2

How to interact with a turtle when it is invisible?

How to interact with a turtle when it is invisible? Question: I have been creating a game with turtle and I was going to make a the background change when a certain area is clicked. So I used a turtle and used the onclick() method when I realized that it did not look good with …

Total answers: 1

How to make the square have blue lines and be at the front of the green line?

How to make the square have blue lines and be at the front of the green line? Question: I want to make the square appear at the start of the green line and be blue. How do I do that? from turtle import * color(‘green’) begin_fill() forward(200) end_fill() import turtle turtle.color(‘blue’) # Creating a for …

Total answers: 1

Python turtle drawing glitch?

Python turtle drawing glitch? Question: I wanted to create a type of "grid" using turtle in python but when I start the program the parts of the drawing had a sort of broken line like this: Glitchy part This is the full image: Full drawing I don’t know is this a glitch or something wrong …

Total answers: 1

DrawRectangleBrick() missing 1 required positional argument: 'y'

DrawRectangleBrick() missing 1 required positional argument: 'y' Question: I am trying to create a brick wall using turtle for my python coding class and I cannot figure out why I am receiving the error "DrawRectangleBrick() missing 1 required positional argument: ‘y’" here is where the issue is: def DrawRectangleBrick(x,y): global SQUARE_SIZE for i in range(4): …

Total answers: 1