I'm using Tkinter and i want to create a lot of windows but, each one with a different object name so i can move them individually.
Example:
def window(self):
self.window1 = Tk()
sizexcenter = str(int(self.root.winfo_screenwidth() / 2 - 20))
sizeycenter = str(int(self.root.winfo_screenheight() / 2 - 20))
self.window1.geometry('40x40' + '+' + sizexcenter + '+' + sizeycenter)
self.window1.overrideredirect(1)
self.window1.mainloop()
And when calling this function next time
def window(self):
self.window2 = Tk()
sizexcenter = str(int(self.root.winfo_screenwidth() / 2 - 20))
sizeycenter = str(int(self.root.winfo_screenheight() / 2 - 20))
self.window2.geometry('40x40' + '+' + sizexcenter + '+' + sizeycenter)
self.window2.overrideredirect(1)
self.window2.mainloop()
And so on, is for Snake game but in windows desktop, each piece of the tail would be a window