脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - Python - Python base64编码解码实例

Python base64编码解码实例

2020-07-16 10:44Python教程网 Python

这篇文章主要介绍了Python base64编码解码实例,本文直接给出实例代码,使用也很简单,需要的朋友可以参考下

Python中进行Base64编码解码要用base64模块,代码示例:

?
1
2
3
4
5
6
7
#-*- coding: utf-8 -*-
import base64
 
str = 'cnblogs'
str64 = base64.b64encode(str)
print str64           #Y25ibG9ncw==
print base64.b64decode(str64)  #cnblogs

延伸 · 阅读

精彩推荐