Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. >>> data = json.loads(open('data.txt').read())
  2. >>> data
  3. [{u'text': u'dicks1'}, {u'text': u'dicks2'}, {u'text': u'vag1'}, {u'text': u'vag2'}]
  4. >>> with open('data.txt', 'w') as outfile:
  5. ... json.dump(data, outfile)
  6. ...
  7. >>> data = json.loads(open('data.txt').read())
  8. >>> data
  9. [{u'text': u'dicks1'}, {u'text': u'dicks2'}, {u'text': u'vag1'}, {u'text': u'vag2'}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement