/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
from Tkinter import * class App: def __init__(self,master): frame = Frame(master) frame.pack() self.button = Button(frame,text = "Quit",fg = "red", command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame,text="Start",command=self.start) self.hi_there.pack(side=LEFT) self.hi_there = Button(frame,text="Stop",command=self.stop) self.hi_there.pack(side=LEFT) self.archivo = StringVar() self.textField = Entry(frame,textvariable=self.archivo) self.textField.pack() self.hi_there.pack(side=RIGHT) def start(self): print("starting") def stop(self): print("stopping") root = Tk() app = App(root) root.mainloop()