FAQ Database Discussion Community


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

python,for-loop,pdb
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 "len(rightarray) = "+str(len(rightarray)) i = 0 j = 0 merged = [] for k in range(n): if i ==...

Open/Export PDB File

foxpro,visual-foxpro,pdb,typeconverter,pdb-files
I have a working application that is using a PDB file as data source. Due to that application is not doing all what the customer wants, I need to know how I can read/write the information from the PDB file. It doesn't matter if I have to export it to...

How do I enter pdb debugger when the datastore is started in setUp(unittest.TestCase)?

google-app-engine,selenium,pdb,python-unittest
I'm confused. It would seem that Client entity should exist because I have 2 locations for it to be created: I create the requested Entity in the the setUp() of the unittest.TestCase. I also conditionally create the Client entity in main.py if it doesn't exist already. I have tried to...

PDB inconsistently recognizing variables [duplicate]

python,django,pdb
This question already has an answer here: Variable alternates whether or not it exists in Python Debugger 2 answers foo (Pdb) *** NameError: name 'foo' is not defined foo = 'foo' (Pdb) print(foo) (Pdb) *** NameError: name 'foo' is not defined foo (Pdb) 27 (note: in a previous pdb...

Debugging a python application that just sort of “hangs”

python,debugging,websocket,pdb
I have an event-driven application, written in python. After a while (usually >1 week) it appears to just stop responding to events. When this happens, I just ctrl-C and re-run and all is well-again. However, it's kind of annoying that this keeps happening and I have no idea what's causing...

Python: how to have code apply to all failures

python,debugging,pdb,try-except
I'm working with the pdb module in python; I just recently found out about it, so I'm a beginner. What I want to do is have a variable that, if True, will call set_trace() on ALL failures that occur in the script without putting it all in a try/except statement....

How to continue to the next loop iteration in Python PDB?

python,debugging,pdb
Given this sample code: import pdb for i in range(10): pdb.set_trace() print(str(i)) When I get the prompt from PDB, how can I skip an iteration of the loop, with the continue loop control statement, when it's also used by PDB, to continue code execution?...

Docker-compose and pdb

python,docker,pdb,docker-compose
I see that I'm not the first one to ask the question but there was no clear answer to this: How to use pdb with docker-composer in Python development? When you ask uncle Google about django docker you get awesome docker-composer examples and tutorials and I have an environment working...

How to debug OpenCV program without Nvidia DLLs?

c++,visual-studio,opencv,nvidia,pdb
Visual Studio Community 2013 Windows 8.1 64bit OpenCV 3.0 beta GPU: NVIDIA GeForce GT 540M and a Intel core graphics. When I want to debug a OpenCV program, all symbol files (.pdb) loaded succeed except nvinit.dll, detoured.dll, Nvd3d9wrap.dll, nvdxgiwrap.dll. VS told me this: 'ImageWatchT.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvinit.dll'. Loading disabled by...

Using iPython with nose?

python,ipython,nose,pdb
I have a fairly basic question. I'm running the nosetests command for my python application's test suite. I want to drop into an interactive debugger. As the tests are run, it hits my IPython.embed() line and freezes, no prompt. Ctrl+C kills it and resumes the tests. How can I drop...