How to use pdb?
R. Bernstein
rocky at panix.com
Sat Jul 22 19:30:08 EDT 2006
tron.thomas at verizon.net writes:
> R. Bernstein wrote:
> > Perhaps what you are looking for is:
> > python /usr/lib/python2.4/pdb.py Myprogram.py
>
> I tried this and it did not work. pdb did not load the file so it
> could be debugged.
lol. Yes, if you are not in the same directory as Myprogram.py you may
have to add be more explicit about where Myprogram.py is.
Reminds me of the story of the guy who was so lazy that when he got an
award for "laziest person alive" he said, "roll me over and put it in
my back pocket." :-)
Glad you were able to solve your problem though.
For other similarly confused folks I have updated pydb's
documentation (in CVS):
In contrast to running a program from a shell (or gdb), no path
searching is performed on the python-script. Therefore python-script
should be explicit enough (include relative or absolute file paths)
so that the debugger can read it as a file name. Similarly, the
location of the Python interpeter used for the script will not
necessarily be the one specified in the magic field (the first line
of the file), but will be the Python interpreter that the debugger
specifies. (In most cases they'll be the same and/or it won't
matter.)
More information about the Python-list
mailing list