Python数据库操作
文件型数据库sqllite读写操作:“`python
None
MySQL数据库读写操作:```python def ExecSql(sql, dbName="", host="", user="", passwd="", charset=''): import MySQLdb conn = MySQLdb.connect(host=host, user=user, passwd=passwd, charset=charset) conn.select_db(dbName) cursor = conn.cursor() cursor.execute(sql) conn.commit() result = cursor.fetchall() cursor.close() conn.close() return result