txtファイルを生成します

輸入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")

もし名前 == ' メイン ':
new_txt()

公開された41元の記事 ウォン称賛7 ビュー3705

おすすめ

転載: blog.csdn.net/weixin_43091087/article/details/100932895