In article 814f91a3-faa4-4473-b28f-8e0e217fb...@f33g2000vbf.googlegroups.com,
odeits ode...@gmail.com wrote:
for row in rows:
ad = dict()
Micro-optimization:
ad = {}
--
Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/
Programming language design is not a
On Mar 9, 1:06 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Sun, 8 Mar 2009 19:07:08 -0700 (PDT), odeits ode...@gmail.com
declaimed the following in gmane.comp.python.general:
i get this error when running that query:
sqlite3.OperationalError: LIMIT clause should come after
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up
andrew cooke wrote:
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries.
On Mar 8, 4:48 am, andrew cooke and...@acooke.org wrote:
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
On Mar 8, 11:31 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Sat, 7 Mar 2009 23:07:55 -0800 (PST), odeits ode...@gmail.com
declaimed the following in gmane.comp.python.general:
For those of you who asked about the SQL the full function is here.
The connection is to a sqlite
On Mar 8, 12:31 pm, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
On Sat, 7 Mar 2009 23:07:55 -0800 (PST), odeits ode...@gmail.com
declaimed the following in gmane.comp.python.general:
For those of you who asked about the SQL the full function is here.
The connection is to a sqlite
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE ads for a user. The check which i think is very ugly is
putting another
ah, yes, i didn't see that clearly. in this case it might be better to have:
def copy(src, dst, name, null):
value = src[name]
dst[name] = null if value is None else value
and then make it explicit in both cases:
copy(row, ad, name, null=None)
...
copy(row, ad, name, null='None')
andrew
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE ads for a user. The check which i think is very ugly is
putting another
Martin P. Hellwig wrote:
cut
def query_parser(QUERY, USER, STACK_SIZE):
indexes = ['ni','adid','rundateid','rundate','city','state','status']
empty = 'None'
stack = []
query_result = self.con.execute(QUERY,(USER,STACK_SIZE)).fetchall()
ni = indexes[0]
for row in
Martin P. Hellwig wrote:
while I am at it :-)
if ignore == False:
is probably cleaner when written
if not ignore:
--
mph
--
http://mail.python.org/mailman/listinfo/python-list
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE ads for a user. The check which i think is very ugly is
putting another
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE
On Mar 7, 10:58 pm, odeits ode...@gmail.com wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE ads for a user. The check which i think is very ugly is
putting another contraint saying
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up to
STACK_SIZE ads for a user. The check which i think is very ugly is
putting another
Thanks a lot! that copy function is a really neat trick!
Yes the ni's are sorted, and yes the query SHOULD be the one to limit it to
just one set of ni's; however, i am having trouble implementing that in sql.
I am using sqlite3 atm and right now i have a very large select statment the
gets me
andrew cooke and...@acooke.org writes:
def copy(src, dst, name, quote_none=False):
value = src[name]
dst[name] = 'None' if quote_none and value is None else value
def copy(src, dst, name, default=None):
value = src[name]
dst[name] = value if value is not None else default
19 matches
Mail list logo