Time for action - running Twill script files
The first way is to store the Twill script in a separate file, and then use the
twill.parse.execute_file function to run it.
- Place the following code into a file called
- Naturally, this script will fail, but go ahead and run it with
twill‑sh to see for yourself.
- Now to run the script from Python. Pull up an interactive Python shell and do the following:
>>> from twill.parse import execute_file
- Simple as that, we ran the script from inside Python code. That would work equally well in doctest, ...