N
N
Niriter Inc.2017-07-18 13:56:52
Python
Niriter Inc., 2017-07-18 13:56:52

Variables in PYQT5?

For example, I have two functions

def test1(self):
     .......
     punk = "hello"
     ......
.......
def test2(self):
     button=QPushButton("Click")
     button.clicked.connect(self.test1)
     .....
     print(punk)
     ......

Now the question is how to remove the punk variable from this function so that it does not lose its value set in the test1 function?
ps Instead of dots, another code that does not matter to this question

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question