Pycharm+pyqt5+python Latest development environment configuration, step into the pit process

Source: Internet
Author: User
Tags qt designer

Python 3.6
https://www.python.org/downloads/windows/
========================================
PyQt5

PIP3 install  pyqt5-i https://pypi.tuna.tsinghua.edu.cn/simple

Installing the graphical interface development tools QT Designer
PIP3 install  pyqt5-tools-i https://pypi.tuna.tsinghua.edu.cn/simple

will C:\Python36\Lib\site-packages\ Pyqt5-tools add to System environment variable
=========================================
Installation tool:
Pycharm Pro 2018.1
PyQT5
python3.6


1, first installed Pycharm, a previous introduction to install the cracked version can be consulted: http://www.roselady.vip/a/cangjingge/boke/2018/0204/685. HTML

2, create a new empty Python project, find setting install third-party module PyQT5, Dot Plus, first PyQT5, then install Pyqt5-tools, followed by Qtdesinger



3, Complete the above modules, set the parameters of the extension tool to find setting->tools->external tools, click the plus sign new tool

4, add Qtdesinger parameters First, program:c:\python36\ Lib\site-packages\pyqt5-tools\designer.exe, this is my need to change to your own,
arguments: $FileDir $\ $FileName $, working directory:$ filedir$, this can be the same as me





6, Dot Plus, add pyuic5 parameters, this is the QT UI file to convert to. py file tool, Program:c:\python36\scripts\pyuic5.exe, this also need to change to your own,
Arguments: $FileName $-O $FileNameWithoutExtension $.py, working directory: $FileDir $, the back one could be the same as me.


7, Dot Plus, add PYRCC parameters, this is to convert the resource files into Python code to recognize the file, this parameter is basically the same as the PYUIC5


, Program:c:\python36\scripts\pyuic5.exe, this also needs to be changed to your own, arguments: $FileName $-O $FileNameWithoutExtension $.py, Working directory: $FileDir $,

8, the above parameter configuration complete PYQT5 can also be said to be basically completed, if you are smooth basic can be installed B


9, directly open Qtdesinger, create a UI file, saved in the Python project's local directory, if the save does not respond to use the Save as, so that the project will appear in the QT UI file


10. Right-click to save the UI file, select External tools->pyuic5 generate code
11, now you right-click the UI file to generate a py file to try, success ... Flowers are needed here!!!!
12. Build a QT Portal Master file and import the PY module you just generated into the run

Import SYS Import MainForm  from Import qapplication, Qmainwindow if __name__ ' __main__ ' :     = qapplication (sys.argv)    = Qmainwindow ()    = Mainform.ui_mainwindow ()    Ui.setupui (MainWindow)    mainwindow.show ()    sys.exit (App.exec_ ())
13, run the main py file, success, I just test add an edit box, the others you can try it yourself

Pycharm+pyqt5+python The latest development environment configuration, step into the pit process detailed

Related Article

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.