JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

base64

发布时间 2023-12-04 11:17:41作者: tslam
import base64

file_path = r'xxx'
with open(file_path, 'rb') as f:
data = f.read()
b64_byte = base64.b64encode(data) # 使用b64对类字节对象进行编码,但是结果还是byte类型
b64_str = b64_byte.decode('utf-8')
print(f'base64_data:\n{b64_str}\ntype:\n{type(b64_str)}')

re_data = base64.b64decode(b64_str) # 解码为二进制数据
print(f're_data:\n{re_data}\ntype:{type(re_data)}')
    本栏目推荐文章
  • Center-based 3D Object Detection and Tracking
  • 多项式定积分计算软件2025 64位WIN版下载Polynomial definite integral calculation software 2025 64 bit WIN version download
  • An improved LSTM-based model for identifying high working intensity load segments of the tractor load spectrum
  • 解析x86与x64:架构之争、性能较量与未来趋势
  • Early lameness detection in dairy cattle based on wearable gait analysis using semi-supervised LSTM-Autoencoder
  • 基于正则化的图自编码器在推荐算法中的应用 Application of graph auto-encoders based on regularization in recommendation algorithms
  • win10/win11安装MinGW-w64(转)
  • Base64编码:数据传输的安全使者
  • android编译kanzi 问题 (3) Build command failed.ninja: error: '../../../../../../lib/android_gradle/ES3_Release/arm64-v8a/xxxxx.so', needed by 'xxxxxx.so', missing and no known rule to make it
  • Learning Dynamic Query Combinations for Transformer-based Object** Detection and Segmentation论文阅读笔记
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们