# Python Tkinter GUI ![](https://i.imgur.com/k94sV5K.png) ## Environment: VScode![](https://i.imgur.com/zhHd1g3.png) ### Import tkinter ```python= from tkinter import * ``` ### Establish the root ```python= root = Tk() root.mainloop() ``` ### Consists of Widgets! ```python= # Creating label widgets myLabel1 = Label(root, text="Hello World!") myLabel2 = Label(root, text="My name is Willie Hung!!") myLabel1.grid(row=0, column=0) myLabel2.grid(row=1, column=1) ``` Generate a user interface like this: ![:](https://i.imgur.com/Q4jU9HJ.png) ### Create a function ```python= from tkinter import * root = Tk() def myClick(): myLabel = Label(root, text="Look! I clicked a label~") myLabel.pack() myButton = Button(root, text="Click Me!", command = myClick) myButton.pack() root.mainloop() ``` U can add a command when u push the button: ![](https://i.imgur.com/nquSFTi.png)