четверг, 3 декабря 2015 г.

python+mysql

во 2 питоне есть MySQLdb, в 3 его нет. Самая простая замена:
import pymysql
pymysql.install_as_MySQLdb()

Более полный список вариантов

There are currently a few options for using Python 3 with mysql:
  • Officially supported by Oracle
  • Pure python
  • A little slow
  • Not compatible with MySQLdb
  • Pure python
  • Faster than mysql-connector
  • Almost completely compatible with MySQLdb, after calling pymysql.install_as_MySQLdb()
  • fork of pymysql with optional C speedups
  • Django's recommended library.
  • Friendly fork of the original MySQLdb, hopes to merge back some day
  • The fastest implementation, as it is C based.
  • The most compatible with MySQLdb, as it is a fork

Комментариев нет:

Отправить комментарий