提交 82b80ce2 编写于 作者: 每日一练社区's avatar 每日一练社区

add code for copy file

上级 7dd08fe8
from src.move_file_to_dailycode import copy_file_to_dailycode
copy_file_to_dailycode()
\ No newline at end of file
import os
import shutil
def copy_file_to_dailycode():
data_dir = 'data/IT冷知识'
dailycode_dir = os.path.join(os.path.abspath(os.path.join(os.getcwd(), "..")), 'daily-code-data')
for i in range(1000):
exercises_path = os.path.join(data_dir, str(i) + '.md')
dst_exercises_path = os.path.join(dailycode_dir, 'data/input/dailycode/it_cold_knowledge/{}.md'.format(i))
if not os.path.exists(exercises_path):
pass
else:
shutil.copy(exercises_path, dst_exercises_path)
# print(exercises_path)
# print(dst_exercises_path)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册