Skip to content

Instantly share code, notes, and snippets.

@zakandrewking
Created May 8, 2014 19:15
Show Gist options
  • Save zakandrewking/1bad4b948b51d4602c2f to your computer and use it in GitHub Desktop.
Save zakandrewking/1bad4b948b51d4602c2f to your computer and use it in GitHub Desktop.
import json
# save a single flux vector as JSON
flux_dictionary = {'asdf': 2}
with open('out.json', 'w') as f:
json.dump(flux_dictionary, f)
flux_dictionary = {'asdf': 2}
# save a flux comparison as JSON
flux_comp = [{'GAPD': 3}, {'GAPD': 4}]
with open('out_comp.json', 'w') as f:
json.dump(flux_comp, f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment