Answer the question
In order to leave comments, you need to log in
How to pass the value of a variable from one function to another function?
How to pass a variable ( b ) from a function ( qwerty ) to another function ( result )???
import sys
from PyQt5.QtWidgets import *
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Пример)))")
self.textEdit = QTextEdit(self)
self.text = self.textEdit.toPlainText()
def qwerty(self):
a = "10"
b = "20"
print(a + b)
self.textEdit.setText(print)
def result(self):
c = self.text
d = c - b # Как передать значение переменной одной функции другой функции?
print(d)
self.textEdit.setText(print)
if __name__ == '__main__':
app = QApplication(sys.argv)
form = Example()
form.show()
app.exec()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question