Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as Tkinter
- def println():
- x = inputBox.get()
- #Replace current label into new label
- label["text"] = x
- label.pack()
- def bye():
- #Close the window
- window.destroy()
- #create window
- window = Tkinter.Tk()
- window.title("Тестов прозорец")
- #create a button
- button1 = Tkinter.Button(window,text="Button1",command=println)
- button1.pack()
- button2 = Tkinter.Button(window,text="Button2",command=bye)
- button2.pack()
- #Create a line of text
- label = Tkinter.Label(window,text="Press this button to be suprised.")
- label.pack()
- #Create an input box
- inputBox = Tkinter.Entry(window)
- inputBox.pack()
- #Show the window
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement