W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
Python decode() 方法以 encoding 指定的編碼格式解碼字符串。默認編碼為字符串編碼。
decode() 方法語法:
str.decode(encoding='UTF-8',errors='strict')
該方法返回解碼后的字符串。
以下實例展示了 decode() 方法的實例:
#!/usr/bin/python
str = "this is string example....wow!!!";
str = str.encode('base64','strict');
print "Encoded String: " + str;
print "Decoded String: " + str.decode('base64','strict')
以上實例輸出結果如下:
Encoded String: dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE=
Decoded String: this is string example....wow!!!
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: