python字典转bytes类型字典import base64 import json 1. a={"Vod":{"userData":"{}".format("e42e6dedf7a5a3fd19689aeb74bb1605")}} r=bytes('{}'.format(a),'utf-8') print(r) #b"{'Vod': {'userData': 'e42e6dedf7a5a3fd19689aeb74bb1605'}}