Created
January 30, 2018 19:44
-
-
Save evandhoffman/3e76848345124dc39291c7cc0c02d2bc to your computer and use it in GitHub Desktop.
Read a file in and put its contents in a JSON param
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
with open(sys.argv[1],"r") as myfile: | |
data=myfile.read() | |
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