make_Yearly_Text_Archive_html_1.py 491 B

1234567891011
  1. def archiveYahooMessage(file, archiveFile, messageYear, format):
  2. try:
  3. f = open(archiveFile, 'a')
  4. if f.tell() == 0:
  5. f.write("<style>pre {white-space: pre-wrap;}</style>\n");
  6. f.write(loadYahooMessage(file, format))
  7. f.close()
  8. print ('Yahoo Message: ' + file + ' archived to: archive-' + str(messageYear) + '.html')
  9. except Exception as e:
  10. print ('Yahoo Message: ' + file + ' had an error:')
  11. print (e)