sqlite3データベースからデータを取得するPythonスクリプトが機能しています。ただし、mysql dbと通信するように変換する必要があります。これが、私に悲しみを与えている最初の行です。
PRODUCT_CODE_ID = "SELECT id FROM localsite_productcode WHERE localsite_productcode.product_code=?"
cur.execute(PRODUCT_CODE_ID,(product_code,))
mysqlでそれを試してみると、次のエラーが発生します。
Traceback (most recent call last):
File "gen-csv.py", line 85, in <module>
cur.execute(PRODUCT_CODE_ID,(product_code,))
File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 151, in execute
query = query % db.literal(args)
TypeError: not all arguments converted during string formatting
私はここで何が間違っているのですか?