I have a python program that I usually run as part of a package:
python -m mymod.client
to deal with relative imports inside "mymod / client.py". How to run this with pdb - python debugger. The following does not work:
python -m pdb mymod.client
Gives an error message:
Error: mymod.client does not exist
EDIT No. 1 (to eliminate the possible duplicity of the question)
My question is not to run two python modules at the same time, but how to use pdb on a python script that has relative imports inside it and which usually deals with running a script with "python -m."
Repeatedly, then the question may arise how to use pdb for such a script without changing the script itself so that it starts with pdb (i.e. keeping the relative import inside the script as much as possible). Isn't that possible, or am I forced to somehow reorganize if I want to use pdb? If so, what would be the minimal changes to the script structure that I would have to introduce to allow me to use pdb.
In general, I don't care how I run the script, only if I can get it to work with pdb without changing its internal structure (relative import, etc.) too much.
python pdb python-module
David simic
source share