My program draws images that already have coordinates attach to them. I want my turtle to be able to pick up the pen when not at the coordinate. Right now the turtle continues to write before getting to the coordinate.
code:
with open('output.txt', 'r') as f:
data = ast.literal_eval(f.read())
tony = turtle.Turtle()
for z in data:
position = tony.pos()
tony.goto(z)
output
1:
As you can see the turtle continues to draw even before getting to the coordinate.
Here's something I think may work but I'm not sure how to implement it.
for z in data:
position = tony.pos()
while position in z == False:
tony.penup()
for z in data:
position = tony.pos()
while position in z == True:
tony.pendown()
print("True")