N
N
NitroDesktop2020-05-09 15:49:14
Python
NitroDesktop, 2020-05-09 15:49:14

How to give os.system output in plainTextEdit?

self.plainTextEdit.setPlainText(os.system("my.exe "+self.lineEdit.text()))

Tried in different ways, but always throws with an error:

Traceback (most recent call last):
File "d:\python\gui\outputpyfile.py", line 77, in buttonClicked1
self.plainTextEdit.paste(os.system("my.exe "+self.lineEdit.text() ))
TypeError: paste(self): too many arguments

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NitroDesktop, 2020-05-09
@NitroDesktop

Solution :

stream = os.popen("my.exe "+self.lineEdit.text())
        self.plainTextEdit.setPlainText(stream.read())

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question