In this Python TKinter article we are going to talk about How to Deploy TKinter GUI Applications, so first of all let’s talk about GUI, Graphical User Interface (GUI) applications can greatly improve the user experience when interacting with software. Python Tkinter library is popular choice for creating GUI applications due to its easy of use and availability in the standard library. in this article we are going to learn how to deploy Tkinter GUI applications.
How to Deploy TKinter GUI Applications
First of all we need to create simple GUI TKinter application, and it will be just a basic GUI Window.
1 2 3 4 5 6 7 8 9 10 11 |
import tkinter as tk class LabelApp(tk.Tk): def __init__(self): super().__init__() self.title("Deploy TKinter") self.label = tk.Label(self, text="Welcome to GeeksCoders.com", font=("Arial", 20)) self.label.pack() app = LabelApp() app.mainloop() |
Run the code and you will see basic GUI Window in TKinter
Once the GUI application has been created next step is to freeze it. freezing an application means packaging it as standalone executable file that can be run on other computers without requiring Python or any other dependencies to be installed.
There are several freezer libraries available for Python such as PyInstaller, cx_Freeze and py2exe. these tools work by analyzing the application code and its dependencies and then bundling everything into single executable file.
So in this article we want to use Pyinstaller, first of all we need to install the library.
1 |
pip install pyinstaller |
Now we can run this command to convert our PY file to EXE file.
1 |
pyinstaller --onefile simple.py |
After that you will see your exe file like this
Learn More on Python GUI
- How to Create Print Dialog in PySide6
- How to Create Button in Python & PySide6
- How to Use Qt Designer with PySide6
- How to Add Icon to PySide6 Window
- How to Load UI in Python PySide6
- How to Create RadioButton in PySide6
- How to Create ComboBox in PySide6
- How to Create CheckBox in Python PySide6
- Responsive Applications with PyQt6 Multithreading
- Event Handling in Python and PyQt6
- How to Use Stylesheets in Python PyQt6