I\'m using this code to get standard output from an external program:
>>> from subprocess import * >>> command_stdout = Popen([\'ls\', \'-l
You need to decode the byte string and turn it in to a character (Unicode) string.
On Python 2
encoding = 'utf-8' 'hello'.decode(encoding)
or
unicode('hello', encoding)
On Python 3
encoding = 'utf-8' b'hello'.decode(encoding)
str(b'hello', encoding)