[DB-SIG] MySQLdb -- BLOB is array

Andy Dustman farcepest at gmail.com
Tue Jul 26 15:23:42 CEST 2005


On 7/25/05, GMane Python <s_david_rose at hotmail.com> wrote:
> Hello all.
>   I'm new to python, and to Mysql, too.  I'm trying stuff out, and wanted to
> take a photo in a program and insert it into a MySQL table as a BLOB.  When
> trying to retrieve it, I get an array('c', <PIL Image instance>).
> 
>   I do a result = cursor.fetchall(), but how can I get the <PIL Image
> instance> from  the result array?

You should read the Python library documentation for the array module,
or type in the interpreter:

>>> help('array')

You may find the tostring() method to be useful.
-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html


More information about the DB-SIG mailing list