Re: why no automatic conversion in string concatenation?

2007-11-13 Thread Michael Pelz Sherman
l "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: On Tue, Nov 13, 2007 at 07:15:06AM -0800, Michael Pelz Sherman wrote regarding why no automatic conversion in string concatenation?: > >As a Java & PHP developer, I find it kind of annoying that I have to >explici

why no automatic conversion in string concatenation?

2007-11-13 Thread Michael Pelz Sherman
As a Java & PHP developer, I find it kind of annoying that I have to explicitly convert non-string variables to strings when concatenating them, especially when python is quite capable of doing the conversion automatically. i.e.: >>> myBool = True >>> print myBool True >>> print "myBool is " +

Re: getting serialized data into and out of a database

2007-10-30 Thread Michael Pelz Sherman
THANK YOU! I needed to use tostring() in this case but the key was realizing what kind of data I was dealing with. Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Mon, 29 Oct 2007 19:07:18 -0300, Michael Pelz Sherman escribió: > I'm having a devil of a time getting serialized

getting serialized data into and out of a database

2007-10-29 Thread Michael Pelz Sherman
I'm having a devil of a time getting serialized data into and out of a database (MySQL in this case) using python and MySQLdb. I have some C code that has its own serialization/deserialization functions, which we've wrapped using SWIG. I am able to save the serialized C structs to disk but when

Re: escape single and double quotes

2007-10-24 Thread Michael Pelz Sherman
, 23 Oct 2007 20:50:55 -0300, Michael Pelz Sherman escribió: > Leif B. Kristensen wrote: > >>>> SQL = 'INSERT into TEMP data = %s' >>>> c.execute(SQL, """ text containing ' and ` and all other stuff we >>> . might >&g

Re: escape single and double quotes

2007-10-23 Thread Michael Pelz Sherman
Leif B. Kristensen wrote: >>> You don't need to escape text when using the Python DB-API. >>> DB-API will do everything for you. >>> For example: >>> SQL = 'INSERT into TEMP data = %s' >>> c.execute(SQL, """ text containing ' and ` and all other stuff we >>. might >>. read from the network""

Re: escape single and double quotes

2007-10-23 Thread Michael Pelz Sherman
Leif B. Kristensen wrote: >>> You don't need to escape text when using the Python DB-API. >>> DB-API will do everything for you. >>> For example: >>> SQL = 'INSERT into TEMP data = %s' >>> c.execute(SQL, """ text containing ' and ` and all other stuff we >>. might >>. read from the network""