- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTkinterBasicWidgets.py
More file actions
Latest commit
26 lines (18 loc) · 582 Bytes
/
Copy pathTkinterBasicWidgets.py
File metadata and controls
26 lines (18 loc) · 582 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#author: Vijesh.V @FreakoutGames
#testing Tkinter package
#Tkinter work in two step way - initializing the widget and second placing the widget
#Alway Tkinter has Tk() and mainloop()
fromtkinterimport*
root=Tk()
defdisplayLabel():
myLabel=Label(root, text=enter.get())
myLabel.pack()
#creating label
#myLabel = Label(root, text="Hello World")
#myLabel1 = Label(root, text="Hello Vijesh")
enter=Entry(root)
enter.pack()
enter.insert(0, "Enter Text")
myButton=Button(root, text="Click Me!", command=displayLabel, fg="red")
myButton.pack()
root.mainloop()