• 大小: 104KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-17
  • 语言: Python
  • 标签: 开源项目  

资源简介

PyMySQL 是一个纯 Python 实现的 MySQL 客户端库,支持兼容 Python 3,用于代替 MySQLdb。


标签:PyMySQL

资源截图

代码片段和文件信息

#!/usr/bin/env python
from __future__ import print_function

import pymysql

conn = pymysql.connect(host=‘localhost‘ port=3306 user=‘root‘ passwd=‘‘ db=‘mysql‘)

cur = conn.cursor()

cur.execute(“SELECT HostUser FROM user“)

print(cur.description)

print()

for row in cur:
    print(row)

cur.close()
conn.close()

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-13 17:05  PyMySQL-master\
     文件         300  2019-03-13 17:05  PyMySQL-master\.coveragerc
     目录           0  2019-03-13 17:05  PyMySQL-master\.github\
     文件         645  2019-03-13 17:05  PyMySQL-master\.github\ISSUE_TEMPLATE.md
     文件         158  2019-03-13 17:05  PyMySQL-master\.gitignore
     文件        1559  2019-03-13 17:05  PyMySQL-master\.travis.yml
     目录           0  2019-03-13 17:05  PyMySQL-master\.travis\
     文件         268  2019-03-13 17:05  PyMySQL-master\.travis\database.json
     文件         237  2019-03-13 17:05  PyMySQL-master\.travis\docker.json
     文件        1642  2019-03-13 17:05  PyMySQL-master\.travis\initializedb.sh
     文件        8988  2019-03-13 17:05  PyMySQL-master\CHANGELOG
     文件        1070  2019-03-13 17:05  PyMySQL-master\LICENSE
     文件          37  2019-03-13 17:05  PyMySQL-master\MANIFEST.in
     文件        4104  2019-03-13 17:05  PyMySQL-master\README.rst
     目录           0  2019-03-13 17:05  PyMySQL-master\docs\
     文件        6775  2019-03-13 17:05  PyMySQL-master\docs\Makefile
     文件        6712  2019-03-13 17:05  PyMySQL-master\docs\make.bat
     目录           0  2019-03-13 17:05  PyMySQL-master\docs\source\
     文件        8443  2019-03-13 17:05  PyMySQL-master\docs\source\conf.py
     文件         225  2019-03-13 17:05  PyMySQL-master\docs\source\index.rst
     目录           0  2019-03-13 17:05  PyMySQL-master\docs\source\modules\
     文件         367  2019-03-13 17:05  PyMySQL-master\docs\source\modules\connections.rst
     文件         421  2019-03-13 17:05  PyMySQL-master\docs\source\modules\cursors.rst
     文件         322  2019-03-13 17:05  PyMySQL-master\docs\source\modules\index.rst
     目录           0  2019-03-13 17:05  PyMySQL-master\docs\source\user\
     文件        1049  2019-03-13 17:05  PyMySQL-master\docs\source\user\development.rst
     文件        1588  2019-03-13 17:05  PyMySQL-master\docs\source\user\examples.rst
     文件         216  2019-03-13 17:05  PyMySQL-master\docs\source\user\index.rst
     文件         657  2019-03-13 17:05  PyMySQL-master\docs\source\user\installation.rst
     文件         331  2019-03-13 17:05  PyMySQL-master\docs\source\user\resources.rst
     文件         320  2019-03-13 17:05  PyMySQL-master\example.py
............此处省略56个文件信息

评论

共有 条评论