listparams

Name

listparams -- Creates a listing of defined parameters.

Synopsis

spectcl.listparams()

DESCRIPTION

This method returns a tuple containing the names of all SpecTcl commands.

EXAMPLES

Example 3-1. Listing all parameters to tkcon


python exec {
params = spectcl.listparams()
for p in params:
    script = 'puts "{}"'.format(p)
    spectcl.tcl(script)
}
                        

This example gets a tuple containing the names of all defined parameters. The for loop then generates a Tcl script to output each parameter name in the tuple to tkcon taking advantage of the fact that Tcl's stdout is tkcon. The scripts are then executed to output the names of the parameters to the console.

Note that if the user's SpecTclRC.tcl does not start TkCon, this will output to the terminal from which SpecTcl started.