print (str.encode()) # 默认编码是 UTF-8 输出:b'\xe5\xad\xa6\xe4\xb9\xa0Python' print (str.encode('gbk')) # 输出 b'\xd1\xa7\xcf\xb0Python' # decode ...