def redirect_output(filename):
 import twill
 fp = open(filename, 'a')
 twill.set_output(fp)

def redirect_output ( filename ) : import twill fp = open ( filename , 'a' ) twill . set_output ( fp )
redirect stdout and stderr to a file .