def output_markdown(filename, **kwargs):
 with codecs.open(filename, 'at') as outfile:
  text = '\n*** \n\n'
  text += '{0} \n\n'.format(time.strftime('%d/%m/%Y, %H:%M'))
  for k in sorted(kwargs):
   if isinstance(kwargs[k], dict):
    dictionary = kwargs[k]
    text += '  - **{0}:**\n'.format(k)
    for entry in sorted(dictionary):
     text += '    - {0}: {1} \n'.format(entry, dictionary[entry])
   elif isinstance(kwargs[k], list):
    text += '  - **{0}:**\n'.format(k)
    for entry in kwargs[k]:
     text += '    - {0}\n'.format(entry)
   else:
    text += '  - **{0}:** {1} \n'.format(k, kwargs[k])
  outfile.write(text)

def output_markdown ( filename , ** kwargs ) : with codecs . open ( filename , 'at' ) as outfile : text = '\n*** \n\n' text += '{0} \n\n' . format ( time . strftime ( '%d/%m/%Y, %H:%M' ) ) for k in sorted ( kwargs ) : if isinstance ( kwargs [ k ] , dict ) : dictionary = kwargs [ k ] text += '  - **{0}:**\n' . format ( k ) for entry in sorted ( dictionary ) : text += '    - {0}: {1} \n' . format ( entry , dictionary [ entry ] ) elif isinstance ( kwargs [ k ] , list ) : text += '  - **{0}:**\n' . format ( k ) for entry in kwargs [ k ] : text += '    - {0}\n' . format ( entry ) else : text += '  - **{0}:** {1} \n' . format ( k , kwargs [ k ] ) outfile . write ( text )
write the output of an analysis to a file .