[code.view]

[top] / python / PyMOTW / json / json_encoder_iterable.py

     #!/usr/bin/env python
     # encoding: utf-8
     #
     # Copyright (c) 2009 Doug Hellmann All rights reserved.
     #
     """
     """
     #end_pymotw_header
     
     import json
     
     encoder = json.JSONEncoder()
     data = [ { 'a':'A', 'b':(2, 4), 'c':3.0 } ]
     
     for part in encoder.iterencode(data):
         print 'PART:', part
     

[top] / python / PyMOTW / json / json_encoder_iterable.py

contact | logmethods.com