I'm new to this language and I'm working on a project using PyQt.
For those who're familiar with PyQt, I created the .ui file using the Qt Designer, and then tried to load it in python.
I find a really 'weird' thing.
Basically, my UI does not work for the following code:
def main():
app = QW.QApplication(sys.argv)
loadUi('my-ui/mainwindow.ui').show()
sys.exit(app.exec_())
No error message, the window simply doesn't show up.
However, if I change the code to this:
def main():
app = QW.QApplication(sys.argv)
w = loadUi('my-ui/mainwindow.ui')
w.show()
sys.exit(app.exec_())
It works like magic!
I'm really confused now. What happens in Python during assignment?
You see, the only thing I've changed is adding an assignment.