[GUI with Python] PyQt5 -Preparation-

【Overview】

It is an environment maintenance for using PyQt5. You can install it your own way.

【environment】

Windows8.1

[Installation]

① Install Anaconda for PYTHON 3.5 from the following site.   DOWNLOAD ANACONDA

(2) Start Spyder of the installed Python IDE.   spyder.png

③ After opening Spyder, open the Console tab at the bottom right. Then select the Options button in the upper right corner and click Open command prompt.   aaaa.png

③ On the console screen   pip install virtualenv And execute. virtualenv will be installed.

④ Similarly on the console screen   virtualenv pyqt   cd pyqt/Scripts   activate To execute. The virtual environment is now created. Then install PyQt5.   pip install pyqt5

This completes the installation of PyQt5. Now let's see how to execute the code. Please replace the location of the file with the environment you want to prepare.

[Program execution method]

(1) Create a "study_pyqt5" folder in the C drive. Save the script file in this folder.

(2) When the folder is created, create a file called "first.py" in it. Open first.py in your favorite editor, copy and paste the code below and save.

first.py


#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
from PyQt5.QtWidgets import QApplication, QWidget

if __name__ == '__main__':
    
    app = QApplication(sys.argv)

    w = QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Simple')
    w.show()
    
    sys.exit(app.exec_())

③ On the Spyder console screen,   cd C:\study_pyqt5   python first.py To execute. Then a screen like the image below will appear.   fdafdsaf.png

The program is now running! : laughing:

[Reference site]

PyQt5 installation PyQt5 Tutorial

Next time will try First programs roughly.

Recommended Posts

[GUI with Python] PyQt5 -Preparation-
[GUI with Python] PyQt5 -Paint-
[GUI with Python] PyQt5 -Widget II-
[GUI with Python] PyQt5 -Custom Widget-
Scraping with Python (preparation)
I made a GUI application with Python + PyQt5
Machine learning with Python! Preparation
[GUI in Python] PyQt5 -Widget-
Python compilation with pyqt deploy
[GUI with Python] PyQt5-Layout management-
Introducing GUI: PyQt5 in Python
[GUI in Python] PyQt5 -Event-
Let's make a GUI with python.
[GUI with Python] PyQt5-The first step-
[GUI with Python] PyQt5-Drag and drop-
I played with PyQt5 and Python3
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Integrate with Python
AES256 with python
Tested with Python
Develop Windows apps with Python 3 + Tkinter (Preparation)
python starts with ()
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
Happy GUI construction with electron and python
Preparation for scraping with python [Chocolate flavor]
Excel with Python
Microcomputer with Python
Cast with python
GUI image cropping tool made with Python + Tkinter
GUI automation with Python x Windows App Driver
You can easily create a GUI with Python
Simple sales tool creation with Python GUI: Quote creation
Open a file dialog with a python GUI (tkinter.filedialog)
Serial communication with Python
Zip, unzip with python
Primality test with Python
Python with eclipse + PyDev.
Socket communication with Python
Data analysis with python 2
Try scraping with Python.
Sequential search with Python
"Object-oriented" learning with python
Run Python with VBA
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Learn Python with ChemTHEATER
Run prepDE.py with python3
Collecting tweets with Python
3. 3. AI programming with Python
Kernel Method with Python
Non-blocking with Python + uWSGI
Scraping with Python + PhantomJS
Posting tweets with python
Drive WebDriver with python