Python comes with a standard GUI package named Tkinter which provides a lot and lots of UI elements for your application like buttons, sliders, menus, check boxes, etc. These are called widgets to create the user interface for your applications. But the problem with Python is it does not offer a drag-and-drop UI designer tools like Visual Studio WinForms.
When you create GUI Python apps like Windows applications, it's really painful to code both application logic and graphic user interface code. You have to write a lot of codes to create simple elements like buttons and checkboxes.
If you want to do drag-and-drop UI design in Python, do not worry. There are a lot of third-party frameworks available to create GUIs for your Python app using the drag-and-drop method.
Here is the list of the best tools to create a Python GUI using the drag-and-drop method.
- PyQt framework (Qt designer)
Many Python developers suggested the PyQt framework to create a Python app GUI. It's a cross-platform framework. So if you create an application with PyQt, you can run that application on many operating systems, like Windows, Mac, Linux, and Raspberry Pi. It has its own drag-and-drop interface named Qt Designer.
When you create a Python GUI in Qt Designer, it produces a special XML format-based file with the.ui extension.
You can just import this .ui extension file in your existing python project or you can convert this.ui file to the Python .py file format.
Understanding and using the PyQt framework is quite difficult for beginners, (but It's worth it)
Now on YouTube, their is no good tutorial available to learn about PyQt framework. I suggest you purchase and read some PyQt based books and get some basic knowledge about PyQt framework.
Best Books to learn about PyQt framework
- Python GUI – Best one for beginners. But this book is about PyQt5, not PyQt6. Also, this book only available in kindle version.
- Create GUI Applications with Python & Qt6 (PyQt6 Edition) – Best one to learn the latest version of PyQT. But little bit complicated for beginners.
How to use the PyQt framework for the first time
- Qt designer from fman build system (only 40 MB)
- Qt for Python package (PyQt6 or PyQt5 or PySlide6) – Install it using the pip command.
Step 1: Install Qt Designer
Just install fman build system Qt designer (only 40 MB installer setup file) or download the latest version of Qt like PyQt 6 (for open-source users) using an offline installer or online installer (It's almost 1GB full setup file).
Step 2: Then, install PyQt or Pyslide Python package ( in a virtual environment)
Install PyQt6 using the following pip command (If you want the latest version of PyQT)
pip install PyQt6
or install PyQt5 using the following command
pip install PyQt5
or install pyside using the pip command.
Step 3: Then run Qt Designer and create an UI for your application.
Add a check box, push-button whatever want for your app, and finally, save the file with the .ui extension.
Then you can directly load this .ui file in your Python project or convert this file to a python file.
Reference: Qt Designer Manual
wxWidget is a cross-platform GUI library. wxFormBuilder is a GUI builder for wxWidget.
Just install this wxFormBuilder software on your computer. Create UI in its designer window and get code in Python, PHP, and C++ programming languages.
First, add Form. Then add a Layout. Now you can insert any other element like a button, text input box, label, etc. Now you get the GUI code. That it.
It converts the Figma design file to a GUI file.
- First, create a frame in Figma. Name it “Windows”.
- Then add a Button or Text Input whatever you want. Use the proper name for your design elements.
- If you finish your UI design in Figma, click the Share and copy link.
- Go to your Profile section -> Settings. Scroll down the screen and create a personal access token. Put any description and copy the token.
- Now install Tkinter designer on your system. For that
- Navigate to the folder you want to install Tkinter Designer on your system.
- Open that folder in the Command prompt.
git clone https://github.com/ParthJadhav/Tkinter-Designer cd Tkinter-Designer pip3 install -r requirements.txt
Now run the GUI file to add file URL and token to generate Python UI file.
cd Python [Your installation Directory/Tkinter-Designer/gui/gui.py
Enter the Token ID, Figma file URL, and set the Output path.
Click Generate. It will generate UI in the “build” folder with gui.py file name.
Python IDEs to create GUI
MD Python Designer (Monthly Subscription & Lifetime license)
Mate Desk Python designer is an IDE-like Visual studio code to create Python applications. It has its own GUI designer to create a python app GUI in Drag and drop method.
Its GUI designer generates Tkinter – TTK-themed widgets code to create the user interface. This software has features like GUI designer, Database browser, create SQLite, MySQL, Postgres databases, build and run your Python .exe apps, etc.
But you have to purchase this app.
Best online Python GUI generators
Visual Tk.com offer only 7 Tkinder core widgets like labels, button, checkbox, ratio button, entry, listbox, message & windows to create your Python UI code online. You can export, or import your currently working project in VisualTK or just copy the Python code. We recommend Visual Tk. It works very well.
Python-GUI-builder works like visual Tk. Just select the type of object you want in that list -> assign the settings and click the “use these values” button. It will generate code for the object. That's it.