After re installing my machine, I've started to have python crashes while using Qt. It seems that when I create a button that runs some code, something that should throw an error crashes instead of erroring.
say for instance:
print(non_existing_var)
should produce this result:
NameError: name 'non_existing_var' is not defined
but instead in ends like this
Process finished with exit code -1073740791 (0xC0000409)
if instead I simply print a string, it works fine...
I've literally no idea what's going on. I've used Qt for years without ever seeing this issue. The only new thing that I'm using is the QApp for standalone that I'm not 100% sure how to use but it was working fine before I re install my machine.
Here is my code:
from PyQt5 import QtWidgets
app = QtWidgets.QApplication([])
class AppTest(QtWidgets.QWidget):
def __init__(self):
super(AppTest, self).__init__()
self.main_layout = QtWidgets.QVBoxLayout(self)
self.setLayout(self.main_layout)
self.resize(1400, 900)
node_1_button = QtWidgets.QPushButton("create input node")
self.main_layout.addWidget(node_1_button)
node_1_button.clicked.connect(self._create_input_node)
def _create_input_node(self):
print("a random string")
print(non_existing_var)
inst = AppTest()
inst.show()
app.exec_()
I work from PyCharm and here are the packages I have:
Any idea?
User contributions licensed under CC BY-SA 3.0