Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36135

Re: Evaluate postgres boolean field

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp.club.cc.cmu.edu!ra.nrl.navy.mil!bloom-beacon.mit.edu!panix!gordon
From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Evaluate postgres boolean field
Date Fri, 4 Jan 2013 19:06:52 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 17
Message-ID <kc798c$79a$1@reader1.panix.com> (permalink)
References <d559ab56-241b-49d0-84fd-ebd0b70426ab@googlegroups.com>
NNTP-Posting-Host panix1.panix.com
X-Trace reader1.panix.com 1357326412 7466 166.84.1.1 (4 Jan 2013 19:06:52 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Fri, 4 Jan 2013 19:06:52 +0000 (UTC)
User-Agent nn/6.7.3
Xref csiph.com comp.lang.python:36135

Show key headers only | View raw


In <d559ab56-241b-49d0-84fd-ebd0b70426ab@googlegroups.com> andydtaylor@gmail.com writes:

> 	for row in cursor:
> 		row_count += 1
> 		if row[4] = True
> 			print row[1]

Since row[4] is a boolean value, you should be able to just say:

   if row[4]:
       print row[1]

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Evaluate postgres boolean field andydtaylor@gmail.com - 2013-01-04 10:08 -0800
  Re: Evaluate postgres boolean field donarb <donarb@nwlink.com> - 2013-01-04 10:50 -0800
  Re: Evaluate postgres boolean field John Gordon <gordon@panix.com> - 2013-01-04 19:06 +0000
    Re: Evaluate postgres boolean field andydtaylor@gmail.com - 2013-01-05 04:24 -0800

csiph-web