0

I am trying to zoom the turtle window in python, but don't know how to proceed. Is there any feature which I can use to zoom the window ? Below is the code where I want to apply zoom. I'm also attaching zip file of code in case below code have indentation errors.

import random
import tkinter as Tkinter
import threading
import time
import turtle

class GUI():
    def ParsePacket():
        n = random.random()
        latitude= 28+n
        longitude=77+n
        
        data =[latitude,longitude]   #random Latitude and Longitude Generator of New Delhi
        return data

def update():
    while True:
        z = GUI.ParsePacket()
        x=z[0]
        y=z[1]
        print(x,y)
        tracy.goto(x,y)
        tracy.pendown()

if __name__ == "__main__":
    root = Tkinter.Tk()
    START_WIDTH = 700 
    START_HEIGHT = 700 
    frame = Tkinter.Frame(root, width=START_WIDTH, height=START_HEIGHT)
    frame.grid_rowconfigure(0, weight=1)
    frame.grid_columnconfigure(0, weight=1)
    canvas = Tkinter.Canvas(frame, width=START_WIDTH, height=START_HEIGHT,
                            scrollregion=(0, 0, START_WIDTH, START_HEIGHT))
    canvas.grid(row=0, column=0, sticky=Tkinter.N+Tkinter.S+Tkinter.E+Tkinter.W)
    frame.pack()
    tracy = turtle.RawTurtle(canvas, visible=False)
    tracy.penup()
    tracy.goto(50.126,8.605)
    tracy.showturtle()
    threading.Thread(target=update).start() 
    root.mainloop()
Lalith Gv
  • 3
  • 2
  • Does this answer your question? [How to implement a drag feature (or zoom) in a python window application?](https://stackoverflow.com/questions/29276229/how-to-implement-a-drag-feature-or-zoom-in-a-python-window-application) – Ben the Coder Apr 05 '23 at 14:32
  • This is not a duplicate of the above question. But [this one](https://stackoverflow.com/a/22275334/1186624). – relent95 Apr 06 '23 at 02:29

0 Answers0