Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Read a file in and put its contents in a JSON param
import json
import sys
with open(sys.argv[1],"r") as myfile:
myjson = { "filename": sys.argv[1], "contents": data }
print json.dumps(myjson, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment