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

软件提交最近更新热门排行
您现在的位置:首页- 编程开发- 数据库类 - Pysqlite for Windows(嵌入式数据库python api 接口)下载
Pysqlite for Windows(嵌入式数据库python api 接口) 2.6.3
84.64%
15.36%

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

请输入预约的手机号码
1877人已预约此游戏
确定取消
  • 软件介绍
  • 软件截图
  • 相关下载
  • 相关文章
点击评论

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()

下载Pysqlite for Windows(嵌入式数据库python api 接口) 2.6.3

普通下载地址:
本地普通下载
湖北电信下载
湖南电信下载
宜昌电信下载
襄阳电信下载
网通用户下载
    1. Python开发工具Python开发工具

      新云软件园Python下载专区提供了Python核心编程和Python开发工具下载,另外还提供了python基础教程等诸多内容。

    软件评论

    请自觉遵守互联网相关政策法规,评论内容只代表网友观点,与本站立场无关!
      验证码:     登录   注册
    网友评论