Skip to content

Instantly share code, notes, and snippets.

Created July 24, 2014 19:22
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 anonymous/d2c56a7d19b371d32c28 to your computer and use it in GitHub Desktop.
Save anonymous/d2c56a7d19b371d32c28 to your computer and use it in GitHub Desktop.
>>> f = open("bla","w")
>>> GO_list = {'Seq_A': ['GO:1234', 'GO:2345', 'GO:3456'],
... 'Seq_B': ['GO:7777', 'GO:8888']}
>>> looked_up_go = csv.writer(f)
>>> for key, val in GO_list.iteritems():
... looked_up_go.writerow([key] + val)
...
>>> f.close()
>>> print open("bla").read()
Seq_A,GO:1234,GO:2345,GO:3456
Seq_B,GO:7777,GO:8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment