bit late here, but if it's as simple as you say, i think it would be much
more efficient (because you only scan checklist and alist once each) to
do:
known = set()
for check in checklist:
known.add(check[0:-1])
missing = filter(lambda alpha: alpha not in known, alist)
andrew
PK wrote:
> Exce
Excellent! Thanks all. Since I need to have this running on python 2.4 as
well, I think I'll choose,
for alpha in alist:
for xy in xlist:
if alpha+xy in checklist:
break
else:
missing.append(alpha)
jus tested and worked like a charm.
Appreciate your help!!
On W
Quoting PK :
> So I'm trying to see whats the cleanest way to do this:
>
> I have a
>
> checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
> either both on one)
>
> allist = [a,b,c,]
> xlist = [x, y, ..]
>
[...]
> now the problem is I want to include alpha in missing l
On Apr 8, 2:15 pm, PK wrote:
> So I'm trying to see whats the cleanest way to do this:
>
> I have a
>
> checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
> either both on one)
>
> allist = [a,b,c,]
> xlist = [x, y, ..]
>
> now I wanna loop through alist and xlist and see i
PK wrote:
So I'm trying to see whats the cleanest way to do this:
I have a
checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
either both on one)
Since you will be repeatedly looking for items in checklist, I suggest
making it a set instead.
allist = [a,b,c,]
xlist
So I'm trying to see whats the cleanest way to do this:
I have a
checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
either both on one)
allist = [a,b,c,]
xlist = [x, y, ..]
now I wanna loop through alist and xlist and see if the combination
exists in checklist
so someth
Carsten Haese wrote:
> On Thu, 2006-09-21 at 01:12, Dennis Lee Bieber wrote:
>
>>On Wed, 20 Sep 2006 13:21:54 -0400, Steve Holden <[EMAIL PROTECTED]>
>>declaimed the following in comp.lang.python:
>>
>>
>>>.execute() is a cursor method, not a connection method. Some DB API
>>>modules do implement
On Thu, 2006-09-21 at 01:12, Dennis Lee Bieber wrote:
> On Wed, 20 Sep 2006 13:21:54 -0400, Steve Holden <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > .execute() is a cursor method, not a connection method. Some DB API
> > modules do implement it as a connection method,
Dennis Lee Bieber wrote:
[...]
> # not conn.execute() ? That's what all the DB-API compliant adapters
> use
>
> result = conn.execute(sql, params)
>
.execute() is a cursor method, not a connection method. Some DB API
modules do implement it as a connection method, but that makes it
impo
Bruno Desthuilliers wrote:
> Fuzzydave wrote:
>
> (snip)
> """
> pubID=cgiForm.getvalue('pubID')
> pubName=cgiForm.getvalue('pubName','Unknown Publication')
>
> sqlcheck1 = "SELECT pub_type FROM medusa.cmi_publication WHERE pub_id =
> '"+pubID+"'"
> overseas1 = conn.query(sqlcheck1)
> pubType = c
Fuzzydave wrote:
> I am back developing futher our Python/CGI based web application run by
> a Postgres DB
> and as per usual I am having some issues. It Involves a lot of Legacy
> code.
s/Legacy/Norwegian Blue/
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.spl
Fuzzydave wrote:
(snip)
"""
pubID=cgiForm.getvalue('pubID')
pubName=cgiForm.getvalue('pubName','Unknown Publication')
sqlcheck1 = "SELECT pub_type FROM medusa.cmi_publication WHERE pub_id =
'"+pubID+"'"
overseas1 = conn.query(sqlcheck1)
pubType = cmi.fetch_rows(overseas1)
"""
May we have the url
I am back developing futher our Python/CGI based web application run by
a Postgres DB
and as per usual I am having some issues. It Involves a lot of Legacy
code. All the actual
SQL Querys are stored in the .py files and run in the .cgi files. I
have the problem that I
need to construct a row from t
13 matches
Mail list logo