Created
May 13, 2020 12:22
-
-
Save gauravbansal98/9222a09624d4d7dfe6a9ae50ce7cf981 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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