![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 71
xkxjy
这个作者很懒,什么都没留下…
展开
-
sqlite3.OperationalError: Could not decode to UTF-8 column XXX with text '***'
环境:python3.2 sqllite3 代码如下: import sqlite3 as sql conn = sql.connect(r'c:\setupinfidb.db', detect_types=sql.PARSE_COLNAMES) c = conn.cursor() c.execute('select * from setuplog') for row in c:原创 2012-11-13 17:19:12 · 3865 阅读 · 1 评论 -
python访问数据库
python 访问数据库 基本流程: 1、建立连接 conn = xxx 2、获取cursor c = conn.cursor() 3、执行sql语句 c.execute() 4、获取结果 c.fetchone() 或 c.fetchall() 返回单条数据或结果集 或 提交 conn.commit() 5、关闭连接 conn.close()原创 2012-11-13 17:16:50 · 405 阅读 · 0 评论 -
python中的zipfile
zipfile — Work with ZIP archives ZipFile.namelist() Return a list of archive members by name. 返回压缩成员名称列表 with ZipFile('spam.zip', 'r') as myzip: for f in myzip.namelist(): print(f原创 2014-02-11 23:19:44 · 1088 阅读 · 0 评论 -
python解析ini文件
python解析ini文件 使用configparser — Configuration file parser sections() add_section(section) has_section(section) 操作section options(section) has_option(section, option) 操作items read(f原创 2014-02-12 22:15:15 · 941 阅读 · 1 评论 -
python备份mysql数据库
介绍使用python结合mysqldump对mysql数据库进行备份 import os import sys import configparser import time def test_file_path(fp): if not os.path.exists(fp): raise RuntimeError('file {} not found'.format(fp))原创 2014-02-12 22:26:16 · 673 阅读 · 0 评论