debug_print(intro_string,
Vars,
Env,
indent=3)
| source code
|
Utility function for printing var values conveniently:
-- C{intro_string}: arbitrary label of type string. Will
be printed as prefix to the info below. Usually the name
of the function calling C{debug_print}, but can be the
empty string.
__ C{Vars}: A tuple of varnames, that is, a tuple of expressions
that evaluate to var names.
-- C{Env}: A dictionary of variable name value pairs, usually
by calling C{vars()}.
For example:
>>> var_printer.debug_print('scanner', ('goal_cat','index'),vars())
prints:
scanner
goal_cat: np
index : 0
if the values of the variables goal_cat and
index in environment vars() are 'np' and '0'
respectively. Note the default indent of 3.
|