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

What is the difference between a break point with argument for condition, and a condition break point?

From The Python Library Reference: b(reak) [[filename:]lineno | function[, condition]] With a lineno argument, set a break there in the current file. With a function argument, set a break at the first executable statement within that function. The…
user1224441
0
votes
1 answer

How to change the default pdb command format in emacs?

In python-mode when I edit a python file, if I type in M-x pdb, it will show Run pdb (like this): pdb filename.py, but it doesn't work, I will have to change it to python -i -m pdb filename.py. I hope the default format to be python -i -m pdb…
Crazymage
  • 114
  • 9
0
votes
1 answer

How to import imports when changing from pdb debugger to python command line

When I am debugging a python program using pdb, I enter into python console mode by writing: (pdb) !import code; code.interact(local=vars()) This is very useful, because it allows you to use python interactively using loops, conditionals and others…
Anthony
  • 443
  • 1
  • 5
  • 16
0
votes
1 answer

When debugging in Python, what is "__getattr__" and how can I avoid it?

Let's say I want to step into my function: -> gene_signature = GeneSignature.from_geo(request.form) (Pdb) s What I always get next is: --Call-- > ../venv/lib/python2.7/site-packages/werkzeug/local.py(335)__getattr__() -> def __getattr__(self,…
jds
  • 7,910
  • 11
  • 63
  • 101
0
votes
1 answer

How to debug strange artefacts in django template?

I'm using django template to render my hierarchical tree in a web page. In the process of rendering of a tree I see these strange whitespaces between nodes: Here is my recursive template: index.html:
Павел Иванов
  • 1,863
  • 5
  • 28
  • 51
0
votes
1 answer

How can i make a loop for a string array in Perl?

I am trying to write a program that will accept a pdb file, extract all the information (atom number, atom type, residue name, residue number, x, y, z, b factor), rearrange the residue number, and save the new pdb in a new archive. I can't find a…
0
votes
1 answer

How do I call pdb's Jump() command in PyCharm

I can't find a way to change the next command at runtime when debugging in PyCharm (see: http://pymotw.com/2/pdb/#jump-back), This has been around in VS/PyTools for ages ("Set next statement"). Some people on JetBrains' forum said it was not…
p0la
  • 11
  • 4
0
votes
1 answer

Running pdb from within pdb

I'm debugging an script that I'm writing and the result of executing a statement from pdb does not make sense so my natural reaction is to try to trace it with pdb. To paraphrase: Yo dawg, I like python, so can you put my pdb in my pdb so I can…
Andrew Farrell
  • 2,368
  • 2
  • 22
  • 25
0
votes
1 answer

interactive use of python console inside function scope without debugging mode

Here is what I want: def f(): x = 3 return Running that in a console and asking for x will not give anything since x is inside the function scope. The alternative is to copy all code in there in a new script, untab it and run it. Then I can…
grokkaine
  • 789
  • 2
  • 7
  • 20
0
votes
1 answer

Python pdb in terminal not showing recent commands

I'm not sure whether this is actually a PDB issue or a terminal issue, but when I press the up arrow (to look for recently used commands), the output shows (Pdb) ^[[A. If I am using a very basic hello world type of python program, I don't have this…
s g
  • 5,289
  • 10
  • 49
  • 82
0
votes
1 answer

Can I debug web2py with pdb in Emacs?

In my Emacs, I started pdb with: Alt-x sudo pdb web2py.py --options values (I am already at web2py directory) After this, I can see the pdb shell in my Emacs, and list the code. Then I setup the breakpoint with b command, and continue with c. My…
David S.
  • 10,578
  • 12
  • 62
  • 104
0
votes
2 answers

python loop for i in range(n) exceeding specified limit n

I am trying to debug a merge method in a program for merge-sort. Here is the method: def merge(self, leftarray, rightarray): n = len(leftarray) + len(rightarray) print "len(leftarray) = "+str(len(leftarray)) print…
Flame of udun
  • 2,136
  • 7
  • 35
  • 79
0
votes
2 answers

pdb error in django code

I'm new to django environment. I need to debug inherited project. The functionI need to debug is in views.py. Let's call it function x. My environment is redhat, apache, django. How do i debug it using pdb. I tried looking at tutorials, but can't…
user2773013
  • 3,102
  • 8
  • 38
  • 58
0
votes
1 answer

How can I get a 3.4 version of pdb?

I tend to use a Debian wheezy system, that ships with Python 2.6, 2.7 and 3.2. However I'm developing now using a local installation Python 3.4 because has a very interesting advantage over Python 3.2. The problem is that I don't know how to install…
1737973
  • 159
  • 18
  • 42
0
votes
1 answer

Launch a PDB shell on exception from a GUI event (wx button)

I've seen Launch an IPython shell on exception, but that doesn't help me here (testing on Python 2.7.1, Ubuntu 11.04). Consider the following example: import wx class Tester(object): def __init__(self, innum): print("innum: " +str(innum)) …
sdaau
  • 36,975
  • 46
  • 198
  • 278