Never see escaped bytes in output.
Project description
Uniout
It makes Python print the object representation in readable chars instead of the escaped string.
Example
>>> from pprint import pprint >>> langs = [ ... 'Hello, world!', ... '你好,世界!', ... 'こんにちは世界', ... u'Hello, world!', ... u'你好,世界!', ... u'こんにちは世界' ... ] ...
Before:
>>> pprint(langs) ['Hello, world!', '\xe4\xbd\xa0\xe5\xa5\xbd\xef\xbc\x8c\xe4\xb8\x96\xe7\x95\x8c\xef\xbc\x81', '\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1\xe3\x81\xaf\xe4\xb8\x96\xe7\x95\x8c', u'Hello, world!', u'\u4f60\u597d\uff0c\u4e16\u754c\uff01', u'\u3053\u3093\u306b\u3061\u306f\u4e16\u754c']
After:
>>> import uniout >>> pprint(langs) ['Hello, world!', '你好,世界!', 'こんにちは世界', u'Hello, world!', u'你好,世界!', u'こんにちは世界']
Installation
You can install it via PyPI,
sudo pip install uniout
or download it manually.
Changelog
v0.3.7
Switch to long-string syntax (''' or """) automatically.
v0.3.6
Fixed the issue with empty string.
v0.3.5
Make it still works for files.
v0.3.4
A better fix for the previous bug.
v0.3.3
Fixed the problem that Uniout can’t be installed by PIP.
v0.3.2
Show the original string if the escaped string can’t be decoded properly.
Use better way to find string literals.
Print more correct unescaped string representation.
v0.3.1
Fixed a bug when Uniout works with IPython.
v0.3
Thanks for the pull requests #3 and #4 from @timtan, it now
works well with IPython,
and also supports stderr.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file uniout-0.3.7.tar.gz
.
File metadata
- Download URL: uniout-0.3.7.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71fcdda8e909ebbc0d4d795f0e8d0c58f69f30fed0e1a38a5a1f676b641e24c1 |
|
MD5 | 3df45169da988df040f21608c9c4346b |
|
BLAKE2b-256 | 600a6e6bc11a44be7ebc5e0975425d61963c271c737ee3e6989a6f8a0fb90800 |