Advertisement
uopspop

Untitled

Nov 8th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import json
  4. import io
  5.  
  6. with io.open('result.jl', 'r') as f:
  7.     # ...
  8.     for line in f:
  9.         # text = line.encode('utf-8-sig')[3:].decode('utf-8-sig') # this works too
  10.         line = line.encode('utf-8')[3:].decode('utf-8')  # this works too
  11.         jsonObj = json.loads(line)
  12.         print(jsonObj['book_name'])
  13.         print(jsonObj)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement