A tool for excel
Project description
#Demo
##新建Excel文件 import os import jerryExcel
# step 1
excel=jerryExcel.ExcelUtil()
path=os.getcwd()
# 设置文件保存路径
filepath=os.path.join(path,"test.xls")
# 传入文件路径 以及表名
newExcel=excel.NewExcelFile(filepath,"sheet1")
# step 2 准备写入的数据
content=["test1","test2","test3"]
newExcel.write(content)
# 传空值相当于换行
newExcel.write()
newExcel.write(content)
# step 3 保存
newExcel.save()
追加excel数据
# 追加excel文件
# step 1 设置文件路径
excel=jerryExcel.ExcelUtil()
path=os.getcwd()
filepath=os.path.join(path,"test.xls")
addtion=excel.AddtionWrite(filepath)
# step 2 写入数据
content=["test1","test2","test3"]
addtion.write(content)
addtion.write()
addtion.write(content)
# step 3 保存
addtion.save()
读取excel数据
# step 1 设置文件路径
excel = jerryExcel.ExcelUtil()
path = os.getcwd()
filepath = os.path.join(path, "test.xls")
cursor = excel.Cursor(filepath)
# step 2 读取数据
datas = cursor.read(ignoreFirstLine=False, index=0)
# step 3 遍历输出数据
for data in datas:
print(data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jerryExcel-1.0.1.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for jerryExcel-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0eb685f87ace0117b41b4b204ebc299104945d295b8396ed4eb1e28a562a62d |
|
MD5 | defdcb99b738c1b81a64e5ca5157aab1 |
|
BLAKE2b-256 | 03d0053b5333095ca17973a7b200d9a47f02d1dd995e5d3a9bfbe0cc6e64b304 |