2011年8月20日土曜日

[Python] arrayからbufferに変換してsqlite3のBLOBにつっこむ。

Python + SQLite3でBLOBに値を入れるとき、"ValueError: could not convert BLOB to buffer" というエラーに悩まされていたんですが、一度 .tostring でほどいてあげないといけなかった模様。

参考:http://stackoverflow.com/questions/3983587/python-2-7-sqlite3-valueerror-could-not-convert-blob-to-buffer

こんな感じでうまくいきました。