def sourcecpy(src, des):
src = os.path.normpath(src)
des = os.path.normpath(des)
if not os.path.exists(src) or not os.path.exists(src):
print("folder is not exist")
sys.exit(1)
# ?????????????????????????
os.chdir(src)
src_file = [os.path.join(src, file) for file in os.listdir()]
for source in src_file:
# ????
if os.path.isfile(source):
shutil.copy(source, des) # ????????????????
# ????
if os.path.isdir(source):
p, src_name = os.path.split(source)
des = os.path.join(des, src_name)
shutil.copytree(source, des) # ??????????????????
# ??CLI?????
评论列表
文章目录