Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import json
  2.  
  3. json_file = json.load(open("temp.json"))
  4.  
  5. result = "" # resulting string
  6.  
  7. for x in json_file["files"]:# "files" for key value that is assigned to
  8. # the file array
  9. chapter_file = open(x)
  10. result += chapter_file.read()
  11.  
  12.  
  13. # open output_file, write out, flush buffer to complete write and close
  14. output_file = open("output.md","w")
  15.  
  16. output_file.write(result)
  17. output_file.flush()
  18. output_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement