![]() |
|
|
|
#1 |
|
hi,
I am new to Python programming.I am not getting exactly pdb.Can anyone tell me effective way to debug python code? Please give me any example. Looking for responce. Thank You. Sushant sushant.sirsikar@gmail.com |
|
|
|
|
#2 |
|
Posts: n/a
|
Here is an outstandingly well written article, with examples, from
Stephen Ferg: http://www.ferg.org/papers/debugging_in_python.html Ravi ravi.annaswamy@gmail.com |
|
|
|
#3 |
|
Posts: n/a
|
On 30 Mar 2006 21:18:50 -0800, declaimed the
following in comp.lang.python: > hi, > I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? I think I toyed with pdb back around 1993... Never needed it... Of course, with so many different languages and debuggers in my life, I've never found time to master any but the old VMS debugger (which is nothing more than a very complex error handler <G>) My typical debugging technique is the infamous "wolf fence" (there's one wolf in Alaska, how do you find it? First build a fence down the middle of the state, wait for the wolf to howl, determine which side of the fence it is on. Repeat process on that side only, until you get to the point where you can see the wolf). In other words; put in a few "print" statements until you find the statement that is failing (then maybe work backwords from the "tracks" to find out where the wolf/bug comes from). -- > ================================================== ============ < > | Wulfraed Dennis Lee Bieber KD6MOG < > | Bestiaria Support Staff < > ================================================== ============ < > Home Page: <http://www.dm.net/~wulfraed/> < > Overflow Page: <http://wlfraed.home.netcom.com/> < Dennis Lee Bieber |
|
|
|
#4 |
|
Posts: n/a
|
wrote:
> hi, > I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? (automated) unit tests + print statements + the interactive shell are usually enough. I almost never used pdb in 5+ years of Python programming. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in ''.split('@')])" bruno at modulix |
|
|
|
#5 |
|
Posts: n/a
|
1.) Print statements
2.) IDEs Most Python IDEs provide visual debuggers so that you don't have to use command line ones such as pdb. As with all languages that allow to be executated as a script as well, print statements usually get the job done quite well in most cases. Please read the Python FAQ (as you should for any new language you learn) in its entirety. http://www.python.org/doc/faq/ It answers your IDE question you posted in the other thread as well as many of your future questions quite well. Ravi Teja |
|
|
|
#6 |
|
Posts: n/a
|
wrote:
> hi, > I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? I too rely mostly on unit tests and print statements for debugging, but occasionally I use winpdb which is a pretty nice GUI debugger. http://www.digitalpeers.com/pythondebugger/ Kent Kent Johnson |
|
|
|
#7 |
|
Posts: n/a
|
Am Thu, 30 Mar 2006 21:18:50 -0800 schrieb sushant.sirsikar:
> hi, > I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? Hi, I try to debug the code while I type: Use "assert". Then if you get an AssertionError you can insert print statements or raise("var=%s var2=%s" % (var, var2)) to narrow down the problem. I never used pdb. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: Thomas Guettler |
|
|
|
#8 |
|
Posts: n/a
|
On 2006-03-31, <> wrote:
> I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? 1) Read your code. Think. 2) Add some "print" statements. 3) goto 1) -- Grant Edwards grante Yow! Where's th' DAFFY at DUCK EXHIBIT?? visi.com Grant Edwards |
|
|
|
#9 |
|
Posts: n/a
|
writes:
> hi, > I am new to Python programming.I am not getting exactly pdb.Can > anyone tell me effective way to debug python code? > Please give me any example. > Looking for responce. > Thank You. > Sushant Well, I guess (in addition to the other good suggestions in this thread) this is an obvious place to plug pydb http://bashdb.sourceforge.net/pydb If you are using pdb, I think you'll find pydb, um, better. R. Bernstein |
|
|
|
#10 |
|
Posts: n/a
|
Dennis Lee Bieber <> writes:
> On 30 Mar 2006 21:18:50 -0800, declaimed the > following in comp.lang.python: > > > hi, > > I am new to Python programming.I am not getting exactly pdb.Can > > anyone tell me effective way to debug python code? > > I think I toyed with pdb back around 1993... Never needed it... > > Of course, with so many different languages and debuggers in my > life, I've never found time to master any but the old VMS debugger > (which is nothing more than a very complex error handler <G>) That's one reason why in my bash and GNU make debugger (and in extending pdb), I've stuck to the gdb command set: the effort that is spent mastering gdb can be transfered in the GNU Make, Bash, *AND* Python debuggers. R. Bernstein |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How To Access HTML elements in code behind??? | nedums_b | Software | 1 | 02-07-2008 07:15 PM |
| Code Monkey want MCTS, Code Monkey take exam | Zimri | MCTS | 0 | 04-03-2007 10:57 PM |
| Circumvent Region Code | hufaunder@yahoo.com | DVD Video | 11 | 01-29-2007 09:51 PM |
| .avi files giving region code error | Craig Cameron | DVD Video | 2 | 03-07-2006 02:49 PM |
| Change region code and PAL to NTSC? | Aloke Prasad | DVD Video | 0 | 02-26-2004 01:54 PM |