生成txt文件

import os
def new_txt():

b = os.getcwd() + '\\cut_D43_CODE\\data'
print(b)
if not os.path.exists(b):
    os.makedirs(b)
for file in range(1000,1020):
    open(b+str(file)+'.txt', "w")

if name == ‘main’:
new_txt()

发布了41 篇原创文章 · 获赞 7 · 访问量 3705

猜你喜欢

转载自blog.csdn.net/weixin_43091087/article/details/100932895