Good day! The question is of course lamer, but I did not find any travel information in Google, or my eyes are not growing from that place. In general, I cannot pass the value of a boolean variable to a module method.
Actually there are two Python files. One is used as a frame, the other as a constructor. To display parts of the frame using the conditions IF..ELSE
Ultimately, I can not pass the value of a variable into a condition. It seems to have described the problem correctly. I can be wrong in the interpretation of words, I apologize in advance. In the python novice, I study by examples. Therefore, if not difficult, then an example. I know the construction of the transfer of a variable, but it is here that it was blunted.
This is the main Login.py file .
from WindowTwitchFrame import WindowTwitchFrame import sys, os from PyQt5.QtWidgets import (QWidget, QToolTip, QPushButton, QApplication, QLabel) from PyQt5.QtGui import (QFont, QIcon, QPixmap) class LoginTwitch(WindowTwitchFrame): app = QApplication(sys.argv) window = WindowTwitchFrame() window.initUI(False) sys.exit(app.exec_()) This is the WindowTwitchFrame.py file .
import sys, os from PyQt5.QtWidgets import (QWidget, QToolTip, QPushButton, QApplication, QLabel) from PyQt5.QtGui import (QFont, QIcon, QPixmap) class WindowTwitchFrame(QWidget): def __init__(self): super().__init__() self.initUI(True) def initUI(self, SLTC): version = 'v0.0.1' def ShowLogoTopCenter(self): lTwitchLogo = QLabel(self) pm = QPixmap('images/logo.png') lTwitchLogo.setPixmap(pm) lTwitchLogo.setStyleSheet('background-color: #6441a5;') lTwitchLogo.setGeometry(250, 50, 300, 110) if SLTC == True: a = ShowLogoTopCenter(self) self.resize(800, 600) self.setWindowTitle('TwitchLight - ' + version) self.setWindowIcon(QIcon('icons/twitch.png')) self.setStyleSheet('background-color: #6441a5;') self.setFixedSize(800, 600) self.show()