Several code editors and IDEs are available for developing Python application e.g. Idle, Spyder, PyDev, Wing, PyCharm, etc. Being a mobile app developer since the past 7+ years, I prefer IDE developed by Jet Brains. Among the aforesaid IDEs for Python language, PyCharm is the one developed by Jet Brains. Throughout this blog, I'll develop applications using PyCharm. In the previous post, it is said that Python does not provide GUI controls, instead, it supports open-source widget toolkit like QT.
Installing PyCharm
By using PyCharm, you can find all the Python tools in one place. It provides code inspections, code completion, efficient error highlighting, rich navigation and automated code refactoring. PyCharm can be downloaded from this link. I would suggest Community Edition which is a lightweight and free version.
Installing Python
Pycharm installation isn't sufficient, you need to download Python Interpreter first. The latest Python release is available and can be downloaded here. In our case, the latest Python version is 3.7.4 which is available for both 32-bits and 64-bits system. Download the executable installer according to your system. I chose Windows x86-64 executable installer from Python 3.7.4rc1 - June 18, 2019, from the aforesaid link. After download, run the executable Windows installer.
Installing PyQt
Once you installed the PyCharm Community Edition, next you need to install PyQt5 and PyQt5Designer for the GUI framework. In python, there are two ways to install dependencies i.e. from Terminal - by entering the command and second way is from File => Settings=>Project Interpreter. You can choose any of these which is convenient for you. I use both of these alternatively for adding dependencies OR installing required packages. From File => Settings=>Project Interpreter option Enter PyQt5 in the top search bar, it will list as shown below:
Select the PyQt5 package and click on Install Package. It takes some time for the installation. PyQt5 reference guide is available here.
Installing PyQt5Designer | PyQt-Tools
PyQt5 provides Python bindings for the Qt cross-platform and application toolkit. Finally, you need to install PyQt5Designer Tool, which contains all the GUI controls required to create any GUI application. Go to File => Settings=>Project Interpreter, then click on + button on right side of the window. Enter PyQt5Designer to search and install:
Click on Install Package and it will be installed. Then click on OK button and window will be closed. Reference guide for the designer is available here.
In case, PyQt5Designer not installed, then try installing PyQt-Tools. It is more convenient to install PyQt-Tools without any error.
In case, PyQt5Designer not installed, then try installing PyQt-Tools. It is more convenient to install PyQt-Tools without any error.
That's all you need so far, for the initial setup for Python GUI application.
No comments:
Post a Comment