Skip to content

Instantly share code, notes, and snippets.

@dpenfoldbrown
Created August 27, 2013 20:43
Show Gist options
  • Save dpenfoldbrown/6358911 to your computer and use it in GitHub Desktop.
Save dpenfoldbrown/6358911 to your computer and use it in GitHub Desktop.
Dictionary write to file
d = { 'a':1, 'b':2, 'c':3, 'd':4 }
outhandle = open("dictfile.txt", 'w')
for (key, val) in d.items():
outhandle.write("{0}\t{1}\n".format(key, val))
outhandle.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment