python 打印异常操作

import sqlite3

#10003[:1]{:2}{2}

db = sqlite3.connect(r'c:\imageDB.db')

cur=db.cursor();

 

db.commit();

try:

cur.execute('insert into cet_t values(?,?)',('title2.jpg',sqlite3.Binary('123'),))

except sqlite3.IntegrityError:

import sys

print sys.exc_info()[0],sys.exc_info()[1]

print 'fuck me!baby'

posted @ 2012-11-25 23:38  godjob  Views(440)  Comments(0Edit  收藏  举报