Hi everyone!
I have a Python 3.4 app using the PyQt5 framework and I'm having an issue.
I setup a QProcess:
def listenToServer(self, MainWindow):
self.ws.start("python3 /home/pi/scara_panel/ws.py")
self.ws.readyReadStandardOutput.connect(self.processServer)
def listenToServer(self, MainWindow):
self.ws = QtCore.QProcess(self)
self.ws.start("python3 /home/pi/scara_panel/ws.py")
self.ws.readyReadStandardOutput.connect(self.processServer)
To copy to clipboard, switch view to plain text mode
And it calls this function:
def processServer(self):
income = str(self.ws.readAllStandardOutput())
print(income)
def processServer(self):
income = str(self.ws.readAllStandardOutput())
print(income)
To copy to clipboard, switch view to plain text mode
On a desktop, it works fine. It flows into to the app. However, when the program is run on a Raspberry Pi, it only displays what its read once the script ws.py terminates.
I've read that this has to do with output buffering in Python. I've tried things like adding the -u flag, but no dice. Any suggestions on how to clear this buffer when using readAllStandardOutput()?
I've tried implementing a few things from http://stackoverflow.com/questions/1...tput-buffering but nothing seems to fix the issue.
Any help is appreciated!
Bookmarks