Tim,
> The underscore is a valid variable-name, idiomatically used for "I don't care
> about this", often seen in places like tuple assignment:
The underscore is also used as an alias for gettext.gettext or
gettext.ugettext so you may want to use another variable-name.
Malcolm
--
http://mail.p
On Thu, May 27, 2010 at 5:47 PM, Tim Chase wrote:
> On 05/27/2010 03:32 PM, Victor Subervi wrote:
>
> On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
>>
>>> That should be:
', '.join(['%s'] * len(values)))
>>>
>>> Or as I've done in the past:
>>>
>>> ', '.join('%s' for _
On 05/27/2010 03:32 PM, Victor Subervi wrote:
On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
That should be:
', '.join(['%s'] * len(values)))
Or as I've done in the past:
', '.join('%s' for _ in values)
Huh? Can you describe that underscore to me? Fascinating!
The underscor
On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote:
> On 05/27/2010 11:56 AM, MRAB wrote:
>
>> Kushal Kumaran wrote:
>>
>>>', '.join('%s' * len(values)))
>>>
>>
>> That should be:
>>
>> ', '.join(['%s'] * len(values)))
>>
>
> Or as I've done in the past:
>
> ', '.join('%s' for _ in
On 05/27/2010 11:56 AM, MRAB wrote:
Kushal Kumaran wrote:
', '.join('%s' * len(values)))
That should be:
', '.join(['%s'] * len(values)))
Or as I've done in the past:
', '.join('%s' for _ in values)
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 27, 2010 at 12:56 PM, MRAB wrote:
> Kushal Kumaran wrote:
> [snip]
>
> Since I'm in a good mood today, here's a little present:
>>
>> def insert(cursor, table, columns, values):
>>"""Insert a row into a table. columns must be a list of column
>>names. values must be a list
On Thu, 2010-05-27 at 17:56 +0100, MRAB wrote:
> Kushal Kumaran wrote:
> [snip]
> > Since I'm in a good mood today, here's a little present:
> >
> > def insert(cursor, table, columns, values):
> > """Insert a row into a table. columns must be a list of column
> > names. values must be a
Kushal Kumaran wrote:
[snip]
Since I'm in a good mood today, here's a little present:
def insert(cursor, table, columns, values):
"""Insert a row into a table. columns must be a list of column
names. values must be a list of values for the new row. The
columns and values must corr
On Thu, May 27, 2010 at 12:11 PM, Kushal Kumaran
wrote:
> Since I'm in a good mood today, here's a little present:
>
> def insert(cursor, table, columns, values):
>"""Insert a row into a table. columns must be a list of column
>names. values must be a list of values for the new row. The
On Thu, 2010-05-27 at 20:47 +0530, Kushal Kumaran wrote:
> On Thu, 2010-05-27 at 10:30 -0400, Victor Subervi wrote:
> > On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
> > wrote:
> >
> > On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > > Hi;
> > > I ha
On Thu, 2010-05-27 at 10:30 -0400, Victor Subervi wrote:
> On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
> wrote:
>
> On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > Hi;
> > I have this code:
> >
> > sql = "insert into %s (%s) va
On Thu, May 27, 2010 at 10:17 AM, Kushal Kumaran
wrote:
> On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> > Hi;
> > I have this code:
> >
> > sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> > string.join(cols[1:], ', '))
> > #cursor.execute(sql, string.join(v
On Thu, 2010-05-27 at 09:34 -0400, Victor Subervi wrote:
> On Thu, May 27, 2010 at 8:34 AM, Victor Subervi
> wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" %
> (personalDataTable, string.join(cols[1:], ', '))
>
On Thu, 2010-05-27 at 08:34 -0400, Victor Subervi wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> string.join(cols[1:], ', '))
> #cursor.execute(sql, string.join(vals[1:], "', '"))
> cursor.execute('insert into %s (%s) values ("%
On Thu, May 27, 2010 at 8:34 AM, Victor Subervi wrote:
> Hi;
> I have this code:
>
> sql = "insert into %s (%s) values ('%%s');" % (personalDataTable,
> string.join(cols[1:], ', '))
> #cursor.execute(sql, string.join(vals[1:], "', '"))
> cursor.execute('insert into %s (%s) values ("%s"
15 matches
Mail list logo