Answer the question
In order to leave comments, you need to log in
How to import a class from another file?
How to import a class from another file in
ZZZ.py folder
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
from PyQt5 import QtCore
import sys
import Case_next.Start_1 # возможно правильно
class Case(QMainWindow):
def __init__(self):
super(Case, self).__init__()
self.case()
def case(self):
loadUi("Case.ui", self)
self.pb_1.clicked.connect(self.start_1)
def start_1(self):
self.go = Case_next.Start_1.Go() # Error
if __name__ == '__main__':
app = QApplication(sys.argv)
case = Case()
case.show()
sys.exit(app.exec_())
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
from PyQt5 import QtCore
import sys
class Go(QMainWindow):
def __init__(self):
super(Go, self).__init__
loadUi("form/serv.ui", self)
self.pb.clicked.connect(self.pprint)
self.pb.setShortcut("return")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question