how to change current working directory while using pdb within emacs

Diez B. Roggisch deets at nospam.web.de
Wed Nov 21 08:28:29 EST 2007


duyanning wrote:

> I have written a pyhton script that will process data file in current
> working directory.
> My script is in an different directory to data file.
> When I debug this script using pdb within emacs, emacs will change the
> current working directory to the directory which include the script,
> so my script cannot find the data file.
> 
> I think this is the problem of emacs because when I start pdb from
> console directly, it will not change current working directory to the
> one of script being debugged.

Just issue

import os
os.chdir('whatever')

inside the pdb-session. Unfortunate, but should work.

Diez





More information about the Python-list mailing list