def set_output(fp):
 import commands, browser
 commands.OUT = browser.OUT = fp

def set_output ( fp ) : import commands , browser commands . OUT = browser . OUT = fp
have standard output from twill go to the given fp instead of stdout .