The TF Python module lets your python module do useful things with TinyFugue. When using /python or python() module tf is already present in the local namespace, but any /python_load script needs to 'import tf'.
tf.err( text ) - sends text to your screen (tferr stream).
tf.eval( string arg ) - is the same as /eval string arg.
tf.getvar( var, (default ) - gets value of var or default if it's not set.
tf.out( text ) - sends text to your screen (tfout stream).
tf.send( text, (world ) - sends text to world (default current) without worrying about the flag/quoting problems of tf.eval()
tf.tfrc() - returns the file name of the loaded .tfrc file (or empty string if none)
tf.world() - returns the name of the current world or empty string if none.
Arbitrary data from TF: Your program can retrieve any information it needs
from TinyFugue by doing the following (for example):
tf.eval( '/test "${world_name}"' )
will return a string containing the name of the current world or:
tf.eval( '/test columns()' )
will return an integer with the number of screen columns. Notice the
quoting is slightly depending on what we expect it to return.
See the included tf-lib/urlwatch.py and tf-lib/config.py for fairly complex examples.
See also: tf python for overall info.