什麼是在Python中使用mysql的「標準」方式。我將標準定義爲不會長時間消失的事物。Python MySQL標準
import _mysql
db = _mysql.connect(host, user, pass, db);
db.query("sql");
VS
import MySQLdb
db = MySQLdb.connect(host, user, pass, db);
cursor = db.cursor();
cursor.execute("sql");
顯然MySQLdb的是_mysql的包裝,但我討厭用包裝他們不維持
http://www.google.com/search?q=python+database – 2010-11-19 18:10:08
爲什麼使用'_mysql'模塊?你在哪裏見過這樣的代碼? – 2010-11-19 18:12:41
_mysql模塊直接基於我熟悉的C API。 – 2010-11-19 18:15:52