0

I have a python doit script that is getting stuck on one step but doesn't throw an error. It would sit all day if I let it. I've checked all the inputs and they look exactly the same as the last time I ran it. How do I debug? I tried using pdb but maybe I don't know how to use it and I googled and couldn't find example code. I can't post my code since its confidential. Just a general how to debug in doit would help me greatly. I use Python 2.7 and yes eventually I'll have to update to 3 but for now I'm using 2.7. (Sorry I have had quite a few ask why I continue with 2.7--- no time right now to update all my scripts, there are over 200)

DuDa
  • 3,718
  • 4
  • 16
  • 36
  • 1
    Why not just learn how to use PDB? Actually, I'd search for videos in this particular case, because it's a "visual" thing, but that's just my preference. Why can't you extract a [mcve] from your script and post that here? That would also make it easier for you to learn debugging it, due to its decreased scope. That said, as a new user here, please take the [tour] and read [ask]. – Ulrich Eckhardt Dec 29 '20 at 18:05

1 Answers1

1

https://pydoit.org/tools.html#set-trace

doit provides a set_trace() function that will call PDB set_trace and make sure stdout output is printed on terminal.

Not your case, but doit also provides a command line option --pdb that automatically drops in PDB when an unhandled exception occurs.

schettino72
  • 2,990
  • 1
  • 28
  • 27