A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-October/122150.html below:

[Python-Dev] [BUG] Trailing spaces in pretty-printed JSON

[Python-Dev] [BUG] Trailing spaces in pretty-printed JSON [Python-Dev] [BUG] Trailing spaces in pretty-printed JSONLeo sdl.web at gmail.com
Sat Oct 13 08:40:50 CEST 2012
Use this script on a json file and observe all the trailing spaces
generated. (screenshot attached.)

#!/usr/bin/env python

"""
Pretty print json file.
"""

if __name__ == '__main__':
    import sys
    import json

    if '-h' in sys.argv or '--help' in sys.argv:
        print "Usage: ppjson <FILE>"
        exit(0)

    assert sys.argv[1], "No file provided"
    with open(sys.argv[1]) as f:
        print json.dumps(json.load(f), indent=4)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: py-json-bug.png
Type: image/png
Size: 37869 bytes
Desc: py-json-bug.png
URL: <http://mail.python.org/pipermail/python-dev/attachments/20121013/9a9267fb/attachment.png>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4