6 Star 0 Fork 0

石正哲/python工具

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fildList.py 626 Bytes
一键复制 编辑 原始数据 按行查看 历史
石正哲 提交于 2021-07-01 12:03 . init
#需要安装 pip install pyexcel-xls
#然后填写表地址及储存地址
import xlrd
import codecs
#表地址
data = xlrd.open_workbook('')
#存储地址
location=""
#仅需填写表地址及存储地址
fildList=''
table = data.sheet_by_name('fildList')
start = 1#
end=table.nrows#每个表的行数
for x in range(start, end):
row = table.row_values(x)
fildList += "// " + row[0] + "\n{\nprop:'" + row[1]+ "',\nlabel: this.$t('"+row[2]+".label."+row[1]+"'),\nwidth: 140\n},\n"
file_name=location+"\\fildList.text"
file =codecs.open(file_name,'w',"utf-8")
print(fildList)
file.write(fildList)
print("完成")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/smartwings/python-tools.git
git@gitee.com:smartwings/python-tools.git
smartwings
python-tools
python工具
master

搜索帮助