.py to pyqt5 code example
Example 1: Python PyQt5
# pip install PyQt5==5.15.2
from PyQt5.QtWidgets import QApplication,QMainWindow,QLabel
import sys
app=QApplication(sys.argv)
app.setStyle('Fusion')
app.setApplicationName('PyQt5 App')
win=QMainWindow()
label=QLabel()
label.setText('An App')
win.setCentralWidget(label)
win.show()
sys.exit(app.exec_())
Example 2: how to convert pyqt5 to python
# To convert pyqt5 file(.ui) to python file(.py)
>> pyuic5 -x file.ui -o file.py