After figuring out that functions like os.system()
return an error code (which I don't want), I've tried the fixes from these links:
All of the suggestions work, except that my output (this has been tested on at least 5 different commands) all comes out like this:
Fixing b'org.kde.Platform/x86_64/5.12\n'...
Fixing b'org.freedesktop.Platform/x86_64/19.08\n'...
Fixing b'org.freedesktop.Platform/x86_64/19.08\n'...
Fixing b'org.freedesktop.Sdk/x86_64/19.08\n'...
Fixing b'org.freedesktop.Platform/x86_64/19.08\n'...
Why am I getting the b' and \n' at the beginning and end of each line? Even simple tests with commands like whoami print this extra garbage. I tried cutting the string, like this:
temp = temp[2:-3]
and it cuts from the data I want (b'org.kde.Platform/x86_64/5.12\n' becomes b'g.kde.Platform/x86_64/5\n') and not the aforementioned stuff.