1.2.1.2 Set (set)

set basename on|off

When showing filenames print only the basename. This option is useful in regression testing where the base file names are the same on different installations even though the directory path may be different. You may want to use this in other situtations as well, like showing a debugger session in a manual such as this one.

set cmdtrace on|off

Show lines as they are read from the debugger command file (or "source" debugger command). This is useful in running regression tests, but it may be helpful in tracking down a problem in your .pydbrc file.

set history filename filename

Set the filename in which to record the command history. (the list of previous commands of which a record is kept). The default file is ~/.pydbhist.

set history save

Set saving of the history record on exit. Use ``on'' to enable the saving, and ``off'' to disable it. Without an argument, saving is enabled.

set history size

Set the size of the command history, ie. the number of previous commands to keep a record of. The default is 256.

set linetrace on|off

If this is set on, the position (file and linenumber) is shown before executing a statement. By default this is off. Using the command-line option "--trace" when invoking pydb implicitly sets this on. For information on "--trace", see 1.1.1.

Using this option will slow down your program. Unless single stepping through a program, normally the debugger is called only at breakpoints or at the call and return of a function or method. However when line tracing is turned on, the debugger is called on execution of every statement.

That said, execution may still be pretty fast. If you want to slow down execution further, see the following option.

set linetrace delay time

One of the useful things you can do with this debugger if you run it via a front-end GUI is watch your program as it executes. To do this, use "set linetrace on" which prints the location before each Python statement is run. Many front-end GUIs like the one in GNU Emacs and ddd will read the location and update the display accordingly.

There is however one catch--Python runs too fast. So by using this option you can set a delay after each statement is run in order for GNU and your eyes to catch up with Python. Specify a floating point indicating the number of seconds to wait. For example:

set linetrace delay 0.5 # 1/2 a second

In my experience half a second is about right.

set listsize lines

Sets how many lines are shown by the list command. See 1.2.9.

set logging

Prints set logging usage.

set logging on|off

Enable or disable logging.

set logging file filename

By default, pydb output will go to both the terminal and the logfile. Set redirect if you want output to go only to the log file.

set logging overwrite on|off

By default, pydb will append to the logfile. Set overwrite if you want set logging on to overwrite the logfile instead.

set logging redirect on|off

By default, pydb output will go to both the terminal and the logfile. Set redirect if you want output to go only to the log file.

set prompt prompt-string

Set debugger's prompt string. By default it is "(Pydb) " with a trailing space. For information on how the prompt changes, see 1.2.

There's currently a bug in the code where specified trailing blanks specified. Furthermore the prompt may change in the future to add a history number. It is generally not advisable to change the prompt.

See About this document... for information on suggesting changes.