Questions tagged [pdb]

This tag refers to the Python debugger. For questions pertaining to the protein database file format, use the protein-database tag. For questions pertaining to Microsoft Program Database files, use the pdb-files tag.

The Python Debugger supports breakpoints, single stepping, inspection of stack frames, source code listing, and evaluation of arbitrary Python code in the context of any stack frame. It also supports post-mortem debugging and can be called under program control.

For questions pertaining to the protein database file format (.pdb), use the tag.

For questions pertaining to Microsoft "Program Database" (.pdb) files, use the tag.

880 questions
0
votes
1 answer

How to find the source of global(ish) variable?

I inherited some large and unwieldy python code. In one file its using a list of commands imported from another file. Looking at it with pdb this commands variable ends up in the global namespace. However there's another file that doesn't look…
confused
  • 713
  • 1
  • 5
  • 16
0
votes
1 answer

How to make a pdb set_trace the first breakpoint

I have pdb.set_trace() in two spots of my code. The problem is that I get multiple stops in the second area when I want it to start somewhere specific. Here is an example: def function(): #some code in here pdb.set_trace() #some more…
0
votes
0 answers

ipython shell not opening

I am working in a virtual environment. Following is the…
Gaurav Kumar
  • 1,091
  • 13
  • 31
0
votes
1 answer

iPython debugger not providing any insight

Let's say I have the following function: def simple_func(): a = 4 b = 5 c = a * b print c Here's what I get when I run %debug simple_func(): NOTE: Enter 'c' at the ipdb> prompt to continue execution. None >…
James Kelleher
  • 1,957
  • 3
  • 18
  • 34
0
votes
0 answers

Python line-by-line execution without user interaction

I want to write Python code that can execute other Python code line by line, but without user interaction as with pdb. I want essentially exec(), but one line at a time. For example, I would like to write code such as this: import…
Dave Doty
  • 285
  • 1
  • 9
0
votes
1 answer

how to know exception point

I have a source code of 500Mb having more than 5K of files written in Python. Sometimes I get exception messages but no idea about the line number and file name of exception. Even sometimes exceptions are not seen on terminal unlit I specifically…
Ravi
  • 173
  • 1
  • 10
0
votes
1 answer

Python PDB inconsistency with command outputs - next statement not outputting

I am trying to step through a python script for some code I wrote over a year ago. The way I recall, when you write a pdb.set_trace() line, the program will halt its execution at that point and print the next line that will be executed. Entering 'n'…
pickle
  • 855
  • 1
  • 7
  • 16
0
votes
1 answer

Why do Python's pdb and code modules interact differently with Theano

I've been trying to debug some Theano code, for which I used Keras as a front end. What I've been doing is inserting either: import pdb pdb.set_trace() or import code code.interact(local=locals(), banner='==>") at the point where I want to begin…
user1245262
  • 6,968
  • 8
  • 50
  • 77
0
votes
0 answers

Jython 2.7.0 jump command not working

I tried to execute "jump" command of pdb lib. I'm using Jython (in a Java application). Command comes with this error: Traceback (most recent call last): File "C:\pdb_jump.py", line 20, in result = [] File…
snargul
  • 13
  • 3
0
votes
2 answers

How to ignore the next pdb-like breakpoints, including set_trace() calls?

I'm having the following issue: I have code very much like the following def my_function(): import pdb; pdb.set_trace() .... During runtime, my function is called a lot of times. I'm interested in inspecting the code execution the first…
vlad-ardelean
  • 7,480
  • 15
  • 80
  • 124
0
votes
1 answer

ipdb list command not work after step into function

I was debugging using ipdb and use step command to step into a function in a another file. And then list command not work anymore. Below is output from debuggin. Am I doing anything wrong? > parse.py(36)() 35 import ipdb;…
0
votes
1 answer

Using pdb in emacs with a miniconda install

I am trying to use pdb as a python debugger in emacs I'm getting the import error issues, as in: https://emacs.stackexchange.com/questions/18190/missing-modules-when-debugging-python-code-in-emacs How to specifiy path when using pdb in emacs? the…
bph
  • 10,728
  • 15
  • 60
  • 135
0
votes
1 answer

How is pdb invoked when running a debugged program till a function from pdb module?

I find there are two ways to invoke pdb. In OS's shell, run pdb myscript.py, which invokes pdb immediately and allows to run pdb commands on the running of myscript.py. in myscript.py, import pdb module, and add some function from pdb module in…
Tim
  • 1
  • 141
  • 372
  • 590
0
votes
1 answer

Python, automatically/programmatically answer raw_input() and similar prompts?

When I run the following code to debug f: import pdb f = lambda x: x**2 pdb.runcall(f, 11) # type step, to step through code. I get a prompt: In this prompt I can enter commands, such as step to step through the function of interest (e.g. f). Is…
applecider
  • 2,311
  • 4
  • 19
  • 35
0
votes
1 answer

How to debug Python script which is automatically called inside a web application?

I'm developing a cassandra storage finder for graphite-api. graphite-api is installed via pip and run via gunicorn so I can't just call the script with a debugger but want to use interactive debugging. When I import pdb in my storage finder and set…
fxk8y
  • 5
  • 4