• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python encode和decode的妙用

python encode和decode的妙用

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python decode encode,encode decode,encode and decode,java encode decode,python encode等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

>>> "hello".encode("hex")
'68656c6c6f'

相应的还可以

>>> '68656c6c6f'.decode("hex")
'hello'

查了一下手册,还有这些codec可用

Codec

Aliases

Operand type

Purpose

base64_codec base64, base-64 byte string Convert operand to MIME base64
bz2_codec bz2 byte string Compress the operand using bz2
hex_codec hex byte string Convert operand to hexadecimal representation, with two digits per byte
idna   Unicode string Implements RFC 3490. New in version 2.3. See also encodings.idna
mbcs dbcs Unicode string Windows only: Encode operand according to the ANSI codepage (CP_ACP)
palmos   Unicode string Encoding of PalmOS 3.5
punycode   Unicode string Implements RFC 3492. New in version 2.3.
quopri_codec quopri, quoted-printable, quotedprintable byte string Convert operand to MIME quoted printable
raw_unicode_escape   Unicode string Produce a string that is suitable as raw Unicode literal in python source code
rot_13 rot13 Unicode string Returns the Caesar-cypher encryption of the operand
string_escape   byte string Produce a string that is suitable as string literal in python source code
undefined   any Raise an exception for all conversions. Can be used as the system encoding if no automatic coercion between byte and Unicode strings is desired.
unicode_escape   Unicode string Produce a string that is suitable as Unicode literal in python source code
unicode_internal   Unicode string Return the internal representation of the operand
uu_codec uu byte string Convert the operand using uuencode
zlib_codec zip, zlib byte string Compress the operand using gzip

</div>

您可能想查找下面的文章:

  • Python中encode()方法的使用简介
  • 简单介绍Python中的decode()方法的使用
  • python encode和decode的妙用
  • Python字符串的encode与decode研究心得乱码问题解决方法

相关文章

  • 基于scrapy实现的简单蜘蛛采集程序
  • Python设计模式之抽象工厂模式
  • Python中列表和元组的使用方法和区别详解
  • Google开源的Python格式化工具YAPF的安装和使用教程
  • Python深入学习之对象的属性
  • 零基础写python爬虫之爬虫框架Scrapy安装配置
  • Python使用Paramiko模块编写脚本进行远程服务器操作
  • 从零学python系列之浅谈pickle模块封装和拆封数据对象的方法
  • python使用cookielib库示例分享
  • Python Web开发模板引擎优缺点总结

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • 举例讲解Python中的身份运算符的使用方法
    • 非递归的输出1-N的全排列实例(推荐)
    • python访问mysql数据库的实现方法(2则示例)
    • 在Django中管理Users和Permissions以及Groups的方法
    • Python 多线程实例详解
    • Python发送Email方法实例
    • python 随机数生成的代码的详细分析
    • Django学习笔记之Class-Based-View
    • 树莓派中python获取GY-85九轴模块信息示例
    • Python MySQLdb模块连接操作mysql数据库实例

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有