K
K
Ksandr132019-04-12 10:47:38
Python
Ksandr13, 2019-04-12 10:47:38

How to pass data to an object of another class in python?

There is a form generated by QtDesigner

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        ...
        self.textEdit_3.setObjectName("textEdit_3")

main class:
from scripts import *
class ExampleApp(QtWidgets.QMainWindow, gui.Ui_MainWindow ):
    def __init__(self):
        super().__init__()
        self.setupUi(self)  
...

and there is a scripts.py module, in which there is one function, without a class yet:
def run_script_function( *args):
           self.textEdit_3.setPlainText(code)

and from this module you need to send data to textEdit_3. Tell me how to make it right so that it works

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