D
D
DenisPy132018-01-25 22:47:15
PHP
DenisPy13, 2018-01-25 22:47:15

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()

How to pass a variable ( b ) from a function ( qwerty ) to another function ( result )???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-01-25
@DenisPy13

are you kidding me?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question