Another MySQL Question

Victor Subervi victorsubervi at gmail.com
Thu Jun 3 14:22:52 EDT 2010


On Thu, Jun 3, 2010 at 1:48 PM, Dennis Lee Bieber <wlfraed at ix.netcom.com>wrote:

> On Thu, 3 Jun 2010 08:49:44 -0400, Victor Subervi
> <victorsubervi at gmail.com> declaimed the following in
> gmane.comp.python.general:
>
> >       options += '%s varchar(40) not null, ' % (op[0].upper() + op[1:])
>
>         Please modernize... Python supports a .capitalize() method for
> strings (I haven't checked the references but I'm pretty sure that's
> been there since 2.3 at least)
>
> >>> s = "this is a mess"
> >>> s.capitalize()
> 'This is a mess'
> >>>
>

Thanks. Didn't know about that!!

>
>        sql = "insert into tmp%s values (%s)" % (tmpTable,
>
>            ", ".join("%s" *
>
>            (4 + len(our_options)))
>        cursor.execute(sql, tuple([store, patientID, prodid, pkg]
>                                                + our_options))
>

A minor tweak of this worked nicely. Thanks again! And thanks to MRAB, too!
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100603/1c8d2478/attachment-0001.html>


More information about the Python-list mailing list