Apr-17-2022, 07:46 PM
Help! Pycharm won't run my code!
I have "main.py" open and when I run it, it doesn't reflect my changes/edits.
Here's the code, it's a bit of a mess as I'm working through some experiments/examples.

I have "main.py" open and when I run it, it doesn't reflect my changes/edits.
Here's the code, it's a bit of a mess as I'm working through some experiments/examples.
import sys
import random
from PySide6 import QtCore, QtWidgets, QtGui
class MyWidget(QtWidgets.QWidget):
def __init__(self):
super().__init__()
#self.button_add_user = QtWidgets.QPushButton("Add User")
#self.layout = QtWidgets.QVBoxLayout(self)
#https://doc.qt.io/qt-5/qvboxlayout.html#details
# QWidgetwindow = new QWidget
# self.button1 = QPushButton("One")
# self.button2 = nQPushButton("Two")
# self.button3 = QPushButton("Three")
# self.button4 = QPushButton("Four")
# self.button5 = QPushButton("Five")
#
# self.layout = QVBoxLayout(self)
#
# self.layout.addWidget(self.button1)
# self.layout.addWidget(self.button2)
# self.layout.addWidget(self.button3)
# self.layout.addWidget(self.button4)
# self.layout.addWidget(self.button5)
self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"]
self.button = QtWidgets.QPushButton("Press me!")
self.text = QtWidgets.QLabel("Hello World", alignment=QtCore.Qt.AlignCenter)
#self.button2 = QtWidgets.QPushButton("Press me!")
self.layout = QtWidgets.QVBoxLayout(self)
self.layout.addWidget(self.text)
self.layout.addWidget(self.button)
self.layout.addWidget(self.button2)
self.button.clicked.connect(self.magic)
@QtCore.Slot()
def magic(self):
self.text.setText(random.choice(self.hello))So, say if I change the button's text to "Click me!", it doesn't run it, it seems to run a different version.
