To do so, you can pass the font parameter like this: lbl = Label(window, text="Hello", font=("Arial Bold", 50)) You can set the label font so you can make it bigger and maybe bold. Without calling the grid function for the label, it won’t show up. So the complete code will be like this: from tkinter import * Then we will set its position on the form using the grid function and give it the location like this: lbl.grid(column=0, row=0) To add a label to our previous example, we will create a label using the label class like this: lbl = Label(window, text="Hello") If you forget to call the mainloop function, nothing will appear to the user. The last line which calls the mainloop function, this function calls the endless loop of the window, so the window will wait for any user interaction till we close it. Specify file types (filter file extensions)įirst, we will import Tkinter package and create a window and set its title: from tkinter import *.Add a filedialog (file & directory chooser).Add a ScrolledText widget (Tkinter textarea).Get radio button value (selected radio button).Add a Checkbutton widget (Tkinter checkbox).
0 Comments
Leave a Reply. |