Skip to content

Instantly share code, notes, and snippets.

@elijahc
Created February 16, 2017 19:43
Show Gist options
  • Save elijahc/46218463ce59eec39f8e64078ab833c0 to your computer and use it in GitHub Desktop.
Save elijahc/46218463ce59eec39f8e64078ab833c0 to your computer and use it in GitHub Desktop.
Dumping input arguments as json
import json
...
# Parse arguments
parser = argparse.ArgumentParser(description='RNN for modeling neuron populations')
...
FLAGS = parser.parse_args()
return FLAGS
with open(TFR_PATH+'/config.json','w') as fp:
json.dump(vars(FLAGS),fp,sort_keys=True, indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment