def print_out(s, newline=True):
 if log_filename:
  try:
   with gfile.GFile(log_filename, mode='a') as f:
    f.write((s + ('\n' if newline else '')))
  except:
   sys.stdout.write(('Error appending to %s\n' % log_filename))
 sys.stdout.write((s + ('\n' if newline else '')))
 sys.stdout.flush()

def print_out ( s , newline = True ) : if log_filename : try : with gfile . GFile ( log_filename , mode = 'a' ) as f : f . write ( ( s + ( '\n' if newline else '' ) ) ) except : sys . stdout . write ( ( 'Error appending to %s\n' % log_filename ) ) sys . stdout . write ( ( s + ( '\n' if newline else '' ) ) ) sys . stdout . flush ( )
print a message out and log it to file .