Skip to content

Instantly share code, notes, and snippets.

@alfredplpl
Created February 24, 2014 14:31
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 alfredplpl/9189363 to your computer and use it in GitHub Desktop.
Save alfredplpl/9189363 to your computer and use it in GitHub Desktop.
import json
#make a test data.
testHash={"A":10,"B":20.0,"C":[30.0,40]}
#dump the variable as a file
with open("E:/test.json","w") as f:
json.dump(testHash,f)
#load from a json file
#with open("E:/test.json","r") as f:
# data=json.load(f)
#print data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment