This is a pyqt5 issue with readAllStandardOutput.
I am using that function to get the return from a bash script.
Code:
features = str(self.runner.readAllStandardOutput())
print(features)
With pyqt5 and python2.7 the result of the print statement is;
Quote:
sometext 234 0 0
somemoretext 234 0 0
textagain 234 45 0.192308
moretext 234 0 0
|
With pyqt5 and python3.7 the result of the print statement is;
Quote:
b'sometext 234 0 0\nsomemoretext 234 0 0\ntextagain 234 45 0.192308\nmoretext 234 0 0\n'
|
Why is b'' wrapped around the output? Subsequent statements slit 'features' using either features.split('\n') or features.splitlines() (I've tried both) but python3.7 will not split the string. The output of features.splitlines or features.split('\n') is;
Quote:
["b'sometext 234 0 0\nsomemoretext 234 0 0\ntextagain 234 45 0.192308\nmoretext 234 0 0\n'"]
|
It doesn't split anything at all. Just puts features into a list as a single element. Not sure how to fix this. Is there a new method with python3.x to grab standard out?
Hope I made the issue clear.
Cheers,