本文實(shí)例講述了Python調(diào)用MySQL存儲(chǔ)過(guò)程并獲得返回值的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
try: conn = MySQLdb.connect ( host = 'localhost', user = 'root', passwd = 'pass', db = 'prod', port = 3306 ) cursor1=conn.cursor() cursor1.execute("CALL error_test_proc()") cursor1.close()except MySQLdb.Error, e: print "Mysql Error %d: %s" % (e.args[0], e.args[1])希望本文所述對(duì)大家的Python程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選