Answer the question
In order to leave comments, you need to log in
How to convert ui to py and then import?
I have 5 ui files and code that works with them. Now I need to convert py to exe. I decided to use pyinstaller as always, but he wants to see ui-files in the same folder with the program.
Googled , I saw that you need to initially convert files from ui to py. I did this, but how do I add them to the program further? In terms of:
import myapp_win1
import myapp_win2
import myapp_win3
import myapp_win4
import myapp_win5
win1 = uic.loadUi("myapp_win1.ui")
Answer the question
In order to leave comments, you need to log in
You import the py-file
In the class, it is first inherited, and then the file with the design is initialized:
class mywindow(mydesign.Ui_MainWindow, QtWidgets.QMainWindow):
def __init__(self):
super(mywindow, self).__init__()
self.setupUi(self) # initialize design from import file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question