编码和解码代理字符对
项目描述
代理
代理
是一个小的、经过测试的Python 3包,用于在Python字符串中编码和解码代理字符对。它在MIT许可协议下发布。
安装
# pip3 install --user surrogates
用法
# python3 -m IPython
[..]
In [1]: import surrogates
In [2]: surrogates.encode('😘')
Out[2]: '\ud83d\ude18'
In [3]: surrogates.decode('\uD83D\uDE18')
Out[3]: '😘'
In [4]: hex(ord('😘'))
Out[4]: '0x1f618'
开发和运行测试
cd "$(mktemp -d)"
git clone https://github.com/hartwork/surrogates
cd surrogates/
python3 -m venv py3
source py3/bin/activate
./setup.py test
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分布
surrogates-1.0.2.tar.gz (4.1 kB 查看哈希值)
构建分布
surrogates-1.0.2-py3-none-any.whl (4.9 kB 查看哈希值)