# -*- coding:utf-8 -*-
# __author__ = "DT"
# __date__ = "20190118"
import os
import os.path
import shutil
import time, datetime
def del_file(path):
for f in os.listdir(path):
path_file = os.path.join(path, f)
if os.path.isfile(path_file):
print("文件" + "\033[1;35m %s \033[0m" %f + "正在删除,请等待2秒钟……")
os.remove(path_file)
time.sleep(2)
else:
print("文件夹" + "\033[1;32m %s \033[0m" %f + "正在删除,请等待2秒钟……")
shutil.rmtree(path_file)
time.sleep(2)
def get_nul_file(fname):
fpath = "/home/qa/" + fname + "/"
result = 0
if not os.path.exists(fpath):
print("\n目标文件不存在,即将为您创建该目录")
while True:
inputExit = raw_input('\n输入回车继续')
if not len(inputExit):
os.mkdir(fpath)
auto_copy.py
最新推荐文章于 2024-05-30 11:17:08 发布