from tkinter import *


class MyApp:

    def __init__(self, rootWin):
        print("MyApp was created!")
        
        self.count  = 0
        b = Button( rootWin, text="Up", command = self.upFunc )
        b.pack()
        b2 = Button( rootWin, command = self.downFunc,  text="Down")
        b2.pack()

        self.l = Label( rootWin, text="count is:" + str(self.count) )
        self.l.pack()

    def upFunc(self):
        self.count = self.count + 1
        self.l.config(text="count is:" + str(self.count) )

    def downFunc(self):
        
        self.count = self.count -1
        
        self.l.config(text="count is:" + str(self.count) )
        

    


rw = Tk()
app = MyApp(rw)

for x in range(5):
   tw = Toplevel()
   MyApp( tw )
   


rw.mainloop()
