DEV Community

macnux
macnux

Posted on

Python GUI Examples

1 Create your first GUI application
2 Create a label widget
2.1 Set label font size
2.2 Setting window size
3 Adding a button widget
3.1 Change button foreground and background colors
3.2 Handle button click event
4 Get input using Entry class (Tkinter textbox)
4.1 Set focus to entry widget
4.2 Disable entry widget
5 Add a combobox widget
6 Add a Checkbutton widget (Tkinter checkbox)
6.1 Set check state of a Checkbutton
7 Add radio buttons widgets
7.1 Get radio button value (selected radio button)
8 Add a ScrolledText widget (Tkinter textarea)
8.1 Set scrolledtext content
8.2 Delete/Clear scrolledtext content
9 Create a MessageBox
9.1 Show warning and error messages
9.2 Show askquestion dialogs
10 Add a SpinBox (numbers widget)
10.1 Set default value for Spinbox
11 Add a Progressbar widget
11.1 Change Progressbar color
12 Add a filedialog (file & directory chooser)
12.1 Specify file types (filter file extensions)
13 Add a Menu bar
14 Add a Notebook widget (tab control)
14.1 Add widgets to Notebooks
15 Add spacing for widgets (padding)

https://likegeeks.com/python-gui-examples-tkinter-tutorial/

Top comments (10)

Collapse
 
themainframech profile image
The Mainframe

Does anyone have any idea how to make a user interface in Python that doesn’t look like it’s from the 90s?

Collapse
 
macnux profile image
macnux

If you don't like Tkinter, you can use PyQt likegeeks.com/pyqt5-tutorial/

Collapse
 
themainframech profile image
The Mainframe

I don’t think there’s much difference between the two in terms of user interface or am I mistaken?

Thread Thread
 
themainframech profile image
The Mainframe

Has anyone ever used solely Python to develop a fully-functional application that features a GUI?

Thread Thread
 
macnux profile image
macnux

Yes, Python frameworks have all capabilities to do that.

Thread Thread
 
themainframech profile image
The Mainframe

I've never seen someone do that before, but I know that it must be possible. Would you be able to link me to a tutorial?

Thread Thread
 
macnux profile image
macnux

You can check the PyQt5 tutorial I pointed out and Tkinter tutorial.

Thread Thread
 
themainframech profile image
The Mainframe

Neither of those provide valuable information that would allow anyone to build a proper, nice-looking user interface using Python (which was what I was originally looking for)

Thread Thread
 
m_herrmann profile image
Michael Herrmann

You may be interested in my PyQt5 tutorial then (link below). It shows how you can use styles to make Qt GUIs look much better.

build-system.fman.io/pyqt5-tutorial

Thread Thread
 
themainframech profile image
The Mainframe

Thanks for sharing! I'm taking a look now. What's your opinion on using designers like QtDesigner?

Tutorial is looking great so far :)