week-7 #9

Merged
Kenwood merged 3 commits from week-7 into master 2021-02-26 00:14:34 -05:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit 030dd0b611 - Show all commits

View File

@ -26,7 +26,7 @@ def save_output_keys(showdict):
showdict = dict(sorted(showdict.items())) # Sort the dict by key showdict = dict(sorted(showdict.items())) # Sort the dict by key
for entry in showdict: # For every dict entry in our show dict for entry in showdict: # For every dict entry in our show dict
result += '{0}: '.format(entry) # Append a new line to represent that entry season count result += '{0}: '.format(int(entry)) # Append a new line to represent that entry season count
if isinstance(showdict[entry], list): # If the entry is a list of shows if isinstance(showdict[entry], list): # If the entry is a list of shows
for show in showdict[entry]: # for very entry in that list of shows for show in showdict[entry]: # for very entry in that list of shows
result += '{0}; '.format(show) # append that show, and a ";" result += '{0}; '.format(show) # append that show, and a ";"
@ -34,7 +34,7 @@ def save_output_keys(showdict):
else: # If the entry is not a list else: # If the entry is not a list
result += '{0}'.format(showdict[entry]) result += '{0}'.format(showdict[entry])
with open('output_keys.txt', 'a') as f: with open('output_keys.txt', 'w') as f:
f.write(result) f.write(result)
def save_output_titles(showdict): def save_output_titles(showdict):
@ -52,7 +52,7 @@ def save_output_titles(showdict):
for item in result: # Convert list to stirng, with \n for item in result: # Convert list to stirng, with \n
resultstring += str(item) + '\n' resultstring += str(item) + '\n'
with open('output_titles.txt', 'a') as f: with open('output_titles.txt', 'w') as f:
f.write(resultstring) f.write(resultstring)
if __name__ == '__main__': if __name__ == '__main__':