Advertisement
cendolinside

UI.py

Sep 1st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | None | 0 0
  1. from tkinter import *
  2. import time
  3.  
  4. class UI:
  5.     def inputDat():      
  6.         ui = Tk()
  7.         ui.geometry("300x300")
  8.         ui.title("Input Data")
  9.         frame1 = Frame(ui)
  10.         frame1.pack()
  11.        
  12.         label1 = Label(frame1, text = "Masukkan nama: ")
  13.         label1.pack(side = LEFT)
  14.  
  15.         textbox1 = Entry(frame1, bd = 5, width = 20)
  16.         textbox1.pack(side = LEFT)
  17.        
  18.         Button1 = Button(ui, text = "Input", command = lambda: UI.process(textbox1.get()))
  19.         Button1.place(x = 150,y = 50)
  20.         ui.mainloop()
  21.  
  22.  
  23.     def process(dat):
  24.        restRFID.getDat(dat)
  25.  
  26. class restRFID(object):
  27.     dat = ""
  28.     #cons = True
  29.     def getDat(dd):
  30.        
  31.         ui2 = Tk()
  32.         ui2.geometry("300x300")
  33.         ui2.title("Get Data")
  34.         frame11 = Frame(ui2)
  35.         frame11.pack()
  36.         var2 = StringVar()
  37.         for i in range(6):
  38.             restRFID.dat += dd + "\n"
  39.             #var2.set(dat)
  40.             time.sleep(0.1)
  41.             frame11.update()
  42.        
  43.         label2 = Label(frame11, text = restRFID.dat)
  44.         label2.pack(side = LEFT)
  45.         restRFID.dat = ""
  46.  
  47.         Button2 = Button(ui2, text = "Back",command = lambda: restRFID.process())
  48.         Button2.place(x = 150,y = 50)
  49.  
  50.         ui2.mainloop()
  51.  
  52.     def process():
  53.         #restRFID.cons = False
  54.         UI.inputDat()
  55.        
  56. if __name__ == '__main__':
  57.     UI.inputDat()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement