python ASCII編碼

bytes >>> type(b'xxxxx') <class 'bytes'> >>> type('xxxxx') <class 'str'> bytes是byte的序列,而str是unicode的序列。   1、str 轉換成 bytes 用 encode() 方法:(注意:這有個坑,str1.encode不加括號和加括號是不一樣的,自己試試,初學貌似2.0不影響,3.0變了,不加括號開發環
相關文章
相關標籤/搜索