I’m trying to make it so that If the arrow reaches the screen boundary it will go up and turn around continuing the code so that I can create a piece of art. I’ve been looking for a post to answer my problem but I can’t find anything that’s specific to this problem. Thanks! Answer I think what’s missing is
Tag: turtle-graphics
Creating Bricks with Turtle Python
i’m very new to programming and in here i’m supposed to create a pyramid shape of bricks where the edge of the pyramid is filled with one color and the inside of it is filled with random colors, but i can’t seem to figure it out how to move the bricks to create a new row, column and the random
Turtle graphic not running?
i’m more of a backend web developer and this is for a friend of mine but i have this issue with turtle where her code wont run and i keep getting syntax errors saying certain things aren’t defined. Heres the code Answer If you use import turtle then you have to use turtle.penup(), turtle.setposition(), etc. Original code would work if
Turtle only completes one iteration of a loop and stops at done()
I am trying Python turtle and I am facing this error: Here is my code: Answer The problem is calling done() in the loop. Let’s check the docs for this function: turtle.done() Starts event loop – calling Tkinter’s mainloop function. Must be the last statement in a turtle graphics program. Must not be used if a script is run from
Is there a way to get and save an angle of a turtle for later?
I’m making a program where the user can click on the screen 3 times and it makes a triangle. It will then find the middle points of those 3 lines. Next, I want it to draw 3 lines perpendicular to each of the lines that make up the triangle (through the middle points). I’m stuck at drawing the perpendicular lines.
Why does my turtle not draw my race lanes?
So I’m making a turtle race, but I wanted to make my code shorter by using def. I haven’t used it before but I looked up examples and I have no idea what my code is missing because it doesn’t work. I basically want to draw a lot of “|” but with 15 rows and 5 columns with 20 ‘spaces’
Nearest Neighbor Search is too long for multiple datas
Firstly, i have an image that I pass in arguments, and i retrieve all of his contours with OpenCV (with the cv.findContours method). I parse this list with my parseArray method to have a well parsed list of x,y contours coordinates of the img [(x1, y1), (x2, y2), …] (The size of this list equals 24163 for my unicorn image)
Why is the turtle not turning?
My turtle won’t move with my key press. When you remove the self.forward part, it turns just fine, but when it moves it doesn’t work. How can I make it so that turtle turns while it is moving. Also, what was it that didn’t work in my code before. Also, the image labeled backround isn’t loading. How do I fix
Turtle Graphics: Onscreenclick doesn’t work
학번, 이름, 전공 it says that Exception in Tkinter callback Traceback (most recent call last): File “C:UserssuyeoAppDataLocalProgramsPythonPython39libtkinter_init_.py”, line 1892, in call return self.func(*args) File “C:UserssuyeoAppDataLocalProgramsPythonPython39libturtle.py”, line 674, in eventfun fun(x, y) TypeError: ‘str’ object is not callable Answer onscreenclick and onkeypress setup callbacks – functions that are called when those events happen. You only need to call these functions once
Turtle onkeypress function not taking input
I was watching a video where the Turtle module was being used for making a Pong game. But the onkeypress function isn’t taking inputs, even after clicking on the window of Pong. OS: Ubuntu 20.04 LTS I pressed the up arrow and even tried other keys, but it didn’t work. Answer Sorry, I just realized my mistake. Here, “sety” was