"Che M" <[EMAIL PROTECTED]> wrote
The reason is merely lack of experience and because of how I was
using the fetchall() in one list comprehension to build each list...
> (heck, you could select code, start, style form codes -- pull all
> the
> information you need in a single query, and skip
2008/9/17 Che M <[EMAIL PROTECTED]>:
>> (heck, you could select code, start, style form codes -- pull all the
>> information you need in a single query, and skip the loop
>> altogether..)
> I think I need the loop because the style will be multiple styles and
> I need to take the codes that go with
> I can't see any obvious reasons for your problems, I'm afraid, but I
> do have a comment on your SQL: the sqlite module supports using ? to
> indicate parameters. So you could rewrite your select statements as:
>
> cur.execute("select code from codes where code != '' and style = ? and
> start
Che M wrote:
[... snip solution around mis-handling a
string split ...]
Glad you solved it. Thanks for coming back with
an update. Depending on your circs, you might want
to try a more general solution to that problem, like:
s = "This, is,a, string, with, varying, amounts, of,space"
print
Che M wrote:
[... snip solution around mis-handling a
string split ...]
Glad you solved it. Thanks for coming back with
an update. Depending on your circs, you might want
to try a more general solution to that problem, like:
s = "This, is,a, string, with, varying, amounts, of,space"
print
> I'm quite willing to help on this, but it's just not quite
> clear enough what's happening. Can I suggest that you
> post a *really small, self-contained* example which demonstrates
> the problem you're having. You might actually realise what's
> wrong as you do that, or if not someone like me
Che M wrote:
(struggling to make an informative subject line)
[ struggling to understand exactly what the problem is... :) ]
I'm quite willing to help on this, but it's just not quite
clear enough what's happening. Can I suggest that you
post a *really small, self-contained* example which demo
2008/9/16 Che M <[EMAIL PROTECTED]>:
> for style in self.style_list:
>
> #Get the codes...
> cur.execute('SELECT code FROM Codes WHERE code != "" AND Style= "' +
> style + '"
> AND start >=' + '"' + self.start_datestring + '"' + 'AND start < "'
> + self.end_datestring + '"')
> m
(struggling to make an informative subject line)
Hi, I have what is no-doubt a dumb problem, but I can't get past it...
Given a list of items, I want to loop through the list, use the item in a
SELECT
statement to query an SQLite database, and use the returned data from a
.fetchall() to add