绿色资源网

电脑版
提示:原网页已由神马搜索转码, 内容由www.downcc.com提供.
您的位置:首页编程开发数据库类→ Pysqlite(嵌入式数据库python api 接口) v2.6.3 官方版

Pysqlite(嵌入式数据库python api 接口)

v2.6.3 官方版Pysqlite(嵌入式数据库python api 接口)网友评分:8
  • 软件大小:472KB
  • 软件语言:中文
  • 软件类型:国产软件
  • 软件类别:免费软件 / 数据库类
  • 更新时间:2017-06-30 14:22
  • 运行环境:WinAll, WinXP, Win7, Win8, Win10
  • 软件等级:4级
  • 软件厂商:
  • 官方网站:暂无
本地下载文件大小:472KB
好评:50%
坏评:50

同类相关软件

软件介绍

软件标签: Pysqlitepython数据库

PysqliteWindows是一款专为windows用户打造的api接口,旨在更好的帮助 sqlite 操作者工作,需要的朋友赶紧来绿色资源网下载吧

Pysqlite Windows版简介

pysqlite是一个sqlite 为 python 提供的 api 接口,它让一切对于 sqlite 的操作都变得异常简单。

sqlite,它是一个嵌入式数据库,没有服务器的概念,windows版的就是一个exe,自己把它放到一个合适的目录里,然后把这个目录加入系统的path变量.

Pysqlite使用说明

在数据库建立中Windows与Linux也有不同

XP版本:sqlite3.exe test.db

Linux版本:./sqlite3.bin test.db

目前针对不同的python版本,pysqlite有3个版本:2.5和2.6 、2.7,请根据自己的python版本选用.

3.然后就可以打开自己喜欢的编辑器,写一段测试代码了.

4.中文处理要注意的是sqlite默认以utf-8编码存储.

5.另外要注意sqlite仅支持文件锁,换句话说,它对并发的处理并不好,不推荐在网络环境使用,适合单机环境;

import pysqlite2.dbapi2 as sqlite

def runTest():

cx = sqlite.connect('test.db')

cu = cx.cursor()

#create

cu.execute('''create table catalog(

id integer primary key,

pid integer,

name varchar(10) unique

)''')

#insert

cu.execute('insert into catalog values(0,0,"张小山")')

cu.execute('insert into catalog values(1,0,"hello")')

cx.commit()

#select

cu.execute('select * from catalog')

print '1:',

print cu.rowcount

rs = cu.fetchmany(1)

print '2:',

print rs

rs = cu.fetchall()

print '3:',

print rs

#delete

cu.execute('delete from catalog where id = 1 ')

cx.commit()

cu.execute('select * from catalog')

rs = cu.fetchall()

print '4:',

print rs

#select count

cu.execute("select count(*) from catalog")

rs = cu.fetchone()

print '5:',

print rs

cu.execute("select * from catalog")

cu.execute('drop table catalog')

if __name__ == '__main__':

runTest()

数据库操作

Python的数据库模块都有统一的接口标准,所以数据库操作都基本上是统一的,基本上分成以下几步(假设数据库模块为db):

用db.connect()创建数据库连接,连接对象为conn。

如果不需要返回查询结果,就直接调用conn.execute()。

如果需要返回查询结果,则需要首先通过conn.cursor()创建游标对象cur,并使用cur.fetchone()等函数获取查询结果。

根据数据库隔离级别的不同,修改数据库后,可能需要使用conn.commit()手动提交事务。

调用相应的close()方法关闭cur及conn。

软件截图

Pysqlite(嵌入式数据库python api 接口) v2.6.3 官方版 0

下载地址电脑版

Pysqlite(嵌入式数据库python api 接口) v2.6.3 官方版

点击报错软件无法下载或下载后无法使用,请点击报错,谢谢!

本类最新

相关文章

用户评论

热门评论

最新评论

发表评论查看所有评论(0)

昵称:
请不要评论无意义或脏话,我们所有评论会有人工审核.
字数: 0/500(您的评论需要经过审核才能显示)

本类软件分类

本类下载排行

本类精品软件

装机必备软件

本类集合软件

360安全卫士

Loading...