def sendOutputTo(outputTo, text):
 if outputTo.endswith('stderr'):
  sys.stderr.write(text)
  sys.stderr.write('\n')
  sys.stderr.flush()
  return
 if outputTo.endswith('stdout'):
  sys.stdout.write(text)
  sys.stdout.write('\n')
  sys.stdout.flush()
  return
 archive.writeFileText(outputTo, text)

def sendOutputTo ( outputTo , text ) : if outputTo . endswith ( 'stderr' ) : sys . stderr . write ( text ) sys . stderr . write ( '\n' ) sys . stderr . flush ( ) return if outputTo . endswith ( 'stdout' ) : sys . stdout . write ( text ) sys . stdout . write ( '\n' ) sys . stdout . flush ( ) return archive . writeFileText ( outputTo , text )
send output to a file or a standard output .