Skip to content

Instantly share code, notes, and snippets.

@gauravbansal98
Created May 13, 2020 12:22
Show Gist options
  • Select an option

  • Save gauravbansal98/9222a09624d4d7dfe6a9ae50ce7cf981 to your computer and use it in GitHub Desktop.

Select an option

Save gauravbansal98/9222a09624d4d7dfe6a9ae50ce7cf981 to your computer and use it in GitHub Desktop.
# save descriptions to file, one per line
def save_descriptions(descriptions, filename):
lines = list()
for key, desc_list in descriptions.items():
for desc in desc_list:
lines.append(key + ' ' + desc)
data = '\n'.join(lines)
file = open(filename, 'w')
file.write(data)
file.close()
# save descriptions
save_descriptions(descriptions, 'descriptions.txt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment