[Tutor] How to format JSON output within script

Vincent Gulinao vincent.gulinao at gmail.com
Tue Aug 18 05:55:41 CEST 2009


Got it, what I need was json.dumps. Sorry I posted too early.

Thanks.

On Tue, Aug 18, 2009 at 11:50 AM, Kent Johnson<kent37 at tds.net> wrote:
> On Mon, Aug 17, 2009 at 11:02 PM, Vincent
> Gulinao<vincent.gulinao at gmail.com> wrote:
>> I see you could pipe your output to 'python -mjson.tool', but how do I
>> achieve the same within my script?
>
> json.tool is a pretty simple wrapper around json.load() and
> json.dump(). You can look at the source code in your Python lib
> directory. (Lib/json/tool.py)
>
> Kent
>


More information about the Tutor mailing list