[twill] How to output text on the screen to a log file

Titus Brown titus at caltech.edu
Fri Mar 31 09:29:40 PST 2006

On Fri, Mar 31, 2006 at 12:04:34PM -0500, Do, Uy N wrote:
-> I tested the redirect_error using twill-sh/ twill-sh - n command and
-> they all worked good. However, when I tried to use the redirect_error
-> command within python script syntax it didn't produce anything in the
-> log file.
-> Here is the script that I tried using python code:
-> -----------------
-> # this script works just fine
-> redirect_error 't3.err'
-> go http://url_throwing_errors
-> code 200
-> ----------------
-> # Nothing was written to file  't3p.err'
-> #!c:\python python
-> from twill.commands import go, follow, showforms, fv, submit, find,
-> notfind, code, save_html, extend_with, config, redirect_output,
-> redirect_error, reset_error
-> import os, time, re
-> redirect_error ('t3p.err')
-> go ('http://url_throwing_errors')
-> code('200')
-> ---------------
-> Do you see anything wrong with the script?

No, it should definitely work. OK, clearly something unfriendly is
happening (on Windows, yes?) that I will have to track down.  I think
the first thing to do is write some tests ;).

It may take me a few days to get to this, though, because I'm travelling
next week and need to prepare.  Sorry ;(.


More information about the twill mailing list