Python操作splite3的例子
来源:互联网 发布:大数据的未来前景 编辑:程序博客网 时间:2024/04/19 13:18
__author__ = 'Administrator'
import sqlite3
def inser(*args,**kwargs):
'''
增加数据输入
'''
#print(args)
cour.execute("insert into mytest(name,telephone,phone,email,qq)values(?,?,?,?,?)",args,)
def insertManyInfo(*args,**kwargs):
pass
def getInfo():
cour.execute("select * from mytest")
for k,n,te,ph,em,q in cour:
print(k," ",n," ",te," ",ph," ",em," ",q)
def getAllInfo():
cour.execute("select * from mytest")
for item in cour.fetchall():
print(item)
con=sqlite3.connect(r"F:\\baidu download\\test.db")
cour=con.cursor()
try:
cour.execute("drop table mytest")
except:
print()
cour.execute("create table mytest(id INTEGER primary key autoincrement not null,"
"name text not null,"
"telephone int not null,"
"phone int not null,"
"email text not null,"
"qq int not null)")
if __name__=="__main__":
inser("Liming","13532100265","010-4565892","619617021@qq.com","619617021")
getInfo()#显示信息#显示单个信息
getAllInfo()#返回的是Tuple
import sqlite3
def inser(*args,**kwargs):
'''
增加数据输入
'''
#print(args)
cour.execute("insert into mytest(name,telephone,phone,email,qq)values(?,?,?,?,?)",args,)
def insertManyInfo(*args,**kwargs):
pass
def getInfo():
cour.execute("select * from mytest")
for k,n,te,ph,em,q in cour:
print(k," ",n," ",te," ",ph," ",em," ",q)
def getAllInfo():
cour.execute("select * from mytest")
for item in cour.fetchall():
print(item)
con=sqlite3.connect(r"F:\\baidu download\\test.db")
cour=con.cursor()
try:
cour.execute("drop table mytest")
except:
print()
cour.execute("create table mytest(id INTEGER primary key autoincrement not null,"
"name text not null,"
"telephone int not null,"
"phone int not null,"
"email text not null,"
"qq int not null)")
if __name__=="__main__":
inser("Liming","13532100265","010-4565892","619617021@qq.com","619617021")
getInfo()#显示信息#显示单个信息
getAllInfo()#返回的是Tuple
0 0
- Python操作splite3的例子
- 写单机看看 简单的splite3
- 将TXT文件数据存进Python内置数据库splite3
- python字符串操作的一些例子
- python操作mysql例子
- python 操作wmi例子
- Python连接DB2操作的一个小例子
- python操作redis简单例子
- python操作redis简单例子
- python操作redis简单例子
- python 操作wmi例子
- python操作redis简单例子
- python操作redis简单例子
- python操作redis简单例子
- python操作redis简单例子
- python--PIL操作像素例子
- python矩阵操作小例子
- 操作Word的例子
- Java 集合系列03之 ArrayList详细介绍(源码解析)和使用示例
- 记一些好书
- CentOS 6.5 64位安装cvuqdisk-1.0.7-1.rpm 报错
- Python 面试题(上)
- PHP in_array的性能问题
- Python操作splite3的例子
- 【折腾日记GEN8_3】VMware vSphere Client的安装
- 编写php扩展的问题
- Python 面试题(下)
- 20个经典管理学定律
- centos7设备命名
- Java 集合系列03之 ArrayList详细介绍(源码解析)和使用示例
- Leetcode 138. Copy List with Random Pointer
- CentOS7安装openjdk、tomcat和mysql流程介绍