I\'m using this code to get standard output from an external program:
>>> from subprocess import * >>> command_stdout = Popen([\'ls\', \'-l
If you should get the following by trying decode():
decode()
AttributeError: 'str' object has no attribute 'decode'
You can also specify the encoding type straight in a cast:
>>> my_byte_str b'Hello World' >>> str(my_byte_str, 'utf-8') 'Hello World'