加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
create_txt.py 895 Bytes
一键复制 编辑 原始数据 按行查看 历史
周何彬 提交于 2022-11-14 20:36 . first commit
def create_txt(date,label,num):
# date = ['2022-11-05', '2022-11-05', '2022-11-06', '2022-11-07']
# label = ["a","b","c","d"]
# num = [1,2,3,4]
# print(len(date))
# print(len(label))
# print(len(num))
def txt_create(name, msg):
desktop_path = "fireflies/txt/" # 新创建的txt文件的存放路径
full_path = desktop_path + name + '.txt' # 也可以创建一个.doc的word文档
file = open(full_path, 'w')
file.write(msg) # msg也就是下面的Hello world!
# file.close()
if len(date) == len(label) == len(num):
for i in range(len(date)):
txt_create(str(label[i])+"."+str(date[i]),str(date[i])+" "+str(num[i]))
else:
print("参数不对")
date = ['2022-11-05', '2022-11-05', '2022-11-06', '2022-11-07']
label = ["a","b","c","d"]
num = [1,2,3,4]
create_txt(date,label,num)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化