Convert bytes to a string

后端 未结 19 2322
野性不改
野性不改 2020-11-21 04:45

I\'m using this code to get standard output from an external program:

>>> from subprocess import *
>>> command_stdout = Popen([\'ls\', \'-l         


        
19条回答
  •  再見小時候
    2020-11-21 04:52

    I think this way is easy:

    >>> bytes_data = [112, 52, 52]
    >>> "".join(map(chr, bytes_data))
    'p44'
    

提交回复
热议问题