Learning Notes 15 configuration and use of--PYTHON3.6+PYCHARM2017.2.3+PYQT5

Source: Internet
Author: User

Recently ready to learn to the Python program in accordance with the GUI format to show the window, look up many blogs on the internet, the phenomenon of mutual reference between the blog, the World article a large codex is not a curious thing, but deceptive is according to the description of your big coffee almost no success, the reason, Because I have installed the latest version of the software, the big players are the previous version, and the blog does not understand the situation in place. Now write down the process that I have configured to refer to those who have the same problem as me.

Software Installation

Python installation Needless to say, go to the official website, install the latest version 3.6.3
Pycharm installation Needless to say, to the official website to install the latest version, according to the online tutorial on the registration can be used. My version is 2017.2.3 and is updated today. has been shown as 2017.2.4 and is obviously the latest version.

Installation Pyqt5 has a lot of holes.
The pip3.6 install PYQT5 is displayed as follows:

Swap with PIP3 install PYQT5. Installation Successful

The new version also needs to be installed Pyqt5-tools
Still can only use the PIP3 install

PIP3 Install Pyqt5-tools

PIP3 Install Pyqt5-tools installation was successful.

Configuration

Open Pycharm and enter file-setting-tools-external tools.

Click on the "+" number to add Qtdesigner, Pyuic and PYRCC

When adding Qtdesigner, the name can be typed as you like, without having to be consistent with the EXE file.
First need to click the first space below "...", according to the directory to find EXE file, select it. This EXE file should be in the Pyqt5-tools directory just installed.

In the second space, "parameters" refers to the exe file execution parameters, that is, we will operate the file, click on the back of the "Macro command", select Filedir Filedir$filename, that is, we will operate the file, The selected UI file is opened each time you click it, and if you keep it blank, each time you open it is the initial interface. The third space is the file storage directory, click the "Macro command", select, that is, we will operate the file, each click will open the selected UI file, if kept empty, then each open is the initial interface. The third space is the file storage directory, click on "Macro command", select filedir$ can be.

Next add pyuic5, first enter the name, you can follow the preferences of their own determination.
The first space to select the Pyuic5.exe file, should be in the scripts directory,
The second space in the input needs to use the "Macro command", in fact, is

PYUIC5 File.ui-o file.py

The abstraction of the command. This step and the old version there is a large difference in many of the online tutorials, are in the first space to fill in the Python.exe, the second space to fill in the Pyuic5 file.ui-o file.py This command, I tried not to.

The third space directly with a macro command.

The PYRCC configuration is consistent with the Pyuic.

Use

     1. Enter Tools-external-tools, select Qtdesigner, display screen:

 2. Save exit after creating form. 3. In the main interface, select the. ui file to convert, select Tools-external-tools, click Pyuic5, then the. ui files are automatically converted to. py files directly in the same directory.
 Of course, you can also select the file after the right button, select Tools-external-tools-pyuic5 can be.
4. Programming between forms and Python, continue after. 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.