我在PYQT4中制作了一个GUI,它涉及5个页面,并从那里弹出窗口等等。我的python文件变得超过1500行,所以我将每个页面拆分成单独的.py文件。现在,当我运行它时,我得到一个循环导入问题..特别是它会说“无法导入等......”
目前的项目结构
page1.py
page2.py
page3.py
page4.py
page5.py
from windowConvertor import convertorPage
from windowDatascience import dataScience
from windowRemoteupload import dataRelease
from windowGame import gamerWindow
我如何解决循环进口问题?拥有1500多条线并最终拥有5000条线条更好吗? 当前的编码设置..
**mainwindow.py**
import windowConvertor
self.button2 = QtGui.QPushButton('Convertor Page', self)
self.button2.clicked.connect(self.pageTwo)
def pageTwo(self):
self.hide()
pagetwo = windowConvertor.convertorPage
pagetwo.show(self)
**windowconvertor.py**
class convertorPage(QtGui.QWidget):
def __init__(self,parent = None):
QtGui.QWidget.__init__(self, parent)
self.initUI()
def initUI(self):
print "YOU MADE IT!!"