Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58566 > unrolled thread
| Started by | Tom P <werotizy@freent.dd> |
|---|---|
| First post | 2013-11-06 16:14 +0100 |
| Last post | 2013-11-06 16:26 +0100 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.lang.python
Python PDB conditional breakpoint Tom P <werotizy@freent.dd> - 2013-11-06 16:14 +0100
[solved]Re: Python PDB conditional breakpoint Tom P <werotizy@freent.dd> - 2013-11-06 16:26 +0100
| From | Tom P <werotizy@freent.dd> |
|---|---|
| Date | 2013-11-06 16:14 +0100 |
| Subject | Python PDB conditional breakpoint |
| Message-ID | <bdv4ltFtjmlU1@mid.individual.net> |
I can't get conditional breakpoints to work. I have a variable ID and I
want to set a breakpoint which runs until ID==11005.
Here's what happens -
-> import sys
...
(Pdb) b 53, ID==11005
Breakpoint 1 at /home/tom/Desktop/BEST Tmax/MYSTUFF/sqlanalyze3.py:53
(Pdb) b
Num Type Disp Enb Where
1 breakpoint keep yes at /home/tom/Desktop/BEST
Tmax/MYSTUFF/sqlanalyze3.py:53
stop only if ID==11005
(Pdb) l
50 for ID in distinct_IDs:
51 cursr.execute("select Date, Temperature from data where
StationID = ? and Date > 1963", ID)
52 datarecords = cursr.fetchall() # [(date, temp),..]
53 B-> ll = len(datarecords)
54 if ll > 150: # and len(results) < 100 :
(Pdb) c
...
std_error too large -132.433 61.967 10912
std_error too large -133.36274 62.2165 10925
std_error too large -137.37 62.82 10946
std_error too large -138.217 64.45 10990
std_error too large -138.32 65.35 11005
std_error too large -138.32 65.35 11005
std_error too large -138.32 65.35 11005
std_error too large -138.32 65.35 11005
std_error too large -134.86625 67.415 11036
std_error too large -135.0 68.22908 11053
...
- in other words it doesn't stop even though the value ID == 11005
shows up. Am I specifying the condition incorrectly?
This is Python 2.7.4, Linux 64 bit.
[toc] | [next] | [standalone]
| From | Tom P <werotizy@freent.dd> |
|---|---|
| Date | 2013-11-06 16:26 +0100 |
| Subject | [solved]Re: Python PDB conditional breakpoint |
| Message-ID | <bdv5drFtogfU1@mid.individual.net> |
| In reply to | #58566 |
On 06.11.2013 16:14, Tom P wrote: ok I figured it. ID is a tuple, not a simple variable. The correct test is ID[0]==11005 > I can't get conditional breakpoints to work. I have a variable ID and I > want to set a breakpoint which runs until ID==11005. > > Here's what happens - >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web