[英]Text to Zip to base64 and vice versa, in Python
我有一個“文本”,該文本轉換為zip,然后轉換為base64。 如果我具有該base64值,如何將其轉換回python中的純文本。 ?
您可以使用base64模塊將base 64轉換回,然后使用zipfile模塊將zip轉換回。
假設將file.txt壓縮到file.zip ,然后將歸檔文件轉換為base 64作為encoded.txt :
file.txt
file.zip
encoded.txt
import zipfile import base64 base64.decode(open('encoded.txt'), open('file.zip', 'w')) ZipFile('file.zip').extractall() plaintext = open('file.txt').read()
[英]base64 encode a zip file in Python
[英]How to decode text with base64 in Python
[英]How to encode text to base64 in python
[英]Base64 Decode Text File To Bin File In Python
[英]searching base64 decoded binary data for text in Python
[英]Python screenshot to base64
[英]python base64 to hex
[英]Base64 Authentication Python
[英]Python: Binary to Base64
[英]Python base64 encryptstring
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.