SHOW:
|
|
- or go back to the newest paste.
| 1 | - | #1/usr/bin/env python |
| 1 | + | #1/usr/bin/env python |
| 2 | - | |
| 2 | + | # Pastbin fuck your captchas! |
| 3 | - | # this is from The Python |
| 3 | + | # this is from The Python |
| 4 | - | # Standard Library by example |
| 4 | + | # Standard Library by example |
| 5 | - | # ISBN13: 9780321767349 |
| 5 | + | # ISBN13: 9780321767349 |
| 6 | - | |
| 6 | + | |
| 7 | - | try: |
| 7 | + | try: |
| 8 | - | import cPickle as pickle |
| 8 | + | import cPickle as pickle |
| 9 | - | except: |
| 9 | + | except: |
| 10 | - | import pickle |
| 10 | + | import pickle |
| 11 | - | import pprint |
| 11 | + | import pprint |
| 12 | - | |
| 12 | + | |
| 13 | - | data = [{'a': 'A', 'b': 2, 'c': 3.0}] |
| 13 | + | data = [{'a': 'A', 'b': 2, 'c': 3.0}]
|
| 14 | - | print 'DATA:', |
| 14 | + | print 'DATA:', |
| 15 | - | pprint.pprint(data) |
| 15 | + | pprint.pprint(data) |
| 16 | - | |
| 16 | + | |
| 17 | - | data_string = pickle.dumps(data) |
| 17 | + | data_string = pickle.dumps(data) |
| 18 | print 'PICKLE: %r' % data_string |