0

If I only convert the QBytearray to str then the output looks like this: b'Enter an input A,B,C:\r\n'

I can get rid of the \r\n by using QBytearray.simplified() then the output looks like this :b'Enter an input A,B,C:'

In order to remove the last b' ' I have to only print string[2:-1] output:Enter an input A,B,C:

These seems like a long way to go about it: simplified,convert to string,strip array. Is there a better method? Currently the data is coming from a Qprocess and being appending to a textBrowser.

s = self.process.readAll()
s = s.simplified()
self.itpBrowser.append(str(s)[2:-1])
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
kaminsknator
  • 1,135
  • 3
  • 15
  • 26

1 Answers1

0

Use bytearray({your QBytearray}).decode()

eyllanesc
  • 235,170
  • 19
  • 170
  • 241