Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@howaboutudance
Created September 4, 2015 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howaboutudance/814aaff7a49c9993f1e0 to your computer and use it in GitHub Desktop.
Save howaboutudance/814aaff7a49c9993f1e0 to your computer and use it in GitHub Desktop.
import json
json_file = json.load(open("temp.json"))
result = "" # resulting string
for x in json_file["files"]:# "files" for key value that is assigned to
# the file array
chapter_file = open(x)
result += chapter_file.read()
# open output_file, write out, flush buffer to complete write and close
output_file = open("output.md","w")
output_file.write(result)
output_file.flush()
output_file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment