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

Inconsistency between database and Django ORM output at breakpoint

While debugging a unit test in Django, I placed the following statement in my code Student.objects.filter(id__in=[1,2]).delete() ... import pdb; pdb.set_trace() At the breakpoint, if I type Student.objects.count(), I can see that it has reduced due…
user
  • 17,781
  • 20
  • 98
  • 124
0
votes
1 answer

ipdb and unknown output

I'm getting an output that I personally can't interpret when using IPDB. Does anyone know what this is or what it's called so I can do some further reading and learn what's going on. Right now I'm not even sure what to google.
canyon289
  • 3,355
  • 4
  • 33
  • 41
0
votes
1 answer

Using pdb in emacs inserts => into my code

I'm trying to learn how to use pdb in emacs. I run emacs in console mode and in my python file I have something like import pdb and pdb.set_trace() at the beginning of the file. I use C-c C-c to execute the buffer and pdb starts running. It works…
Mark
  • 5,286
  • 5
  • 42
  • 73
0
votes
1 answer

post effect of renumbering residue number of pdb using biopython

In the following code, I parsed the pdb and computed secondary structure using DSSP library. After parsing and storing values, I renumbered the residue number but I did not modify _pdb and _dssp instances. After renumbering, it also renumbered the…
Exchhattu
  • 197
  • 3
  • 15
0
votes
3 answers

I'm trying to save my result into a new file but got problems - Python

I'm trying to make an script which takes all rows starting by 'HELIX', 'SHEET' and 'DBREF' from a .txt, from that rows takes some specifical columns and then saves the results on a new file. #!/usr/bin/python import sys if len(sys.argv) != 3: …
Alejandra_RS
  • 25
  • 1
  • 1
  • 7
0
votes
3 answers

Python pdb breakpoint after 10 seconds

On some occasions, my python program won't response because there seems to be a deadlock. Since I have no idea where this deadlock happens, I'd like to set a breakpoint or dump the stack of all threads after 10 seconds in order to learn what my…
Matt3o12
  • 4,192
  • 6
  • 32
  • 47
0
votes
0 answers

PDB/Django issue with any()

I was trying to use any to do a match of keywords to a string (example below taken from another SO question) as below. For some reason it runs fine in django shell as well as python but when I run it in pdb, it gives me an error. Am I missing…
Sandeep
  • 346
  • 5
  • 8
0
votes
0 answers

Strange exception with Django middleware and pdb

I am running django 1.5.5 with uwsgi. I am getting this exception in uwsgi, everything works fine with runserver: ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) django.core.exceptions.ImproperlyConfigured: Error …
AgDude
  • 1,167
  • 1
  • 10
  • 27
0
votes
2 answers

Interactive Shell for Ruby on Rails

When working on a web app in python/flask, I am able to import pdb at the top of a file, and then call pdb.set_trace() somewhere in my code to "pause" the web app and open an interactive console in my terminal for debugging. I am looking for…
Jason B
  • 7,097
  • 8
  • 38
  • 49
0
votes
1 answer

Error try to get a string representation of an instance through ipdb

I have this class: class Point(PointAbstract): """ Class used to expand shapely.geometry.Point functionality """ def __unicode__(self): return '%s, %s' % (self.x, self.y) def __repr__(self): return '%s, %s' %…
chachan
  • 2,382
  • 1
  • 26
  • 41
0
votes
0 answers

How to display the whole script when using pdb in gvim

when using pdb in gvim by executing :!python % the window that shows the progress of PDB will gradually scroll out the window that shows the whole python scripts. but sometimes I need to have a quick glance at the entire scripts. I know by typing…
Chenming Zhang
  • 2,446
  • 2
  • 26
  • 34
0
votes
1 answer

stop emacs swapping windows when setting breakpoints

Context: This is GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) running on Debian 6.0.7. When running pdb (M-x pdb), emacs switches which buffer is in which window when I set a breakpoint. I've searched the internet and here, and…
0
votes
1 answer

Running commands from a file in PDB

I would like to run a set of python commands from a file in the PDB debugger. Related to this, can I set up a file that is automatically run when PDB starts?
justintime
  • 3,601
  • 4
  • 22
  • 37
0
votes
3 answers

Python pdb not breaking in files properly?

I wish I could provide a simple sample case that occurs using standard library code, but unfortunately it only happens when using one of our in-house libraries that in turn is built on top of sql alchemy. Basically, the problem is that this break…
YGA
  • 9,546
  • 15
  • 47
  • 50
0
votes
2 answers

Activating set_trace() selectively at runtime in pdb or sisters

In pdb/ipdb/pudb, is there a trick whereby I can selectively activate set_trace() statements during runtime? I'm debugging somewhat complex code with probabilistic behavior, and I would like to interact with the program without the debugger…
Basel Shishani
  • 7,735
  • 6
  • 50
  • 67