我创建了一个程序,复制和移动文件到不同的方向。我想在整个过程中添加一个进度条会很有趣。
我该如何处理?在
我的剧本多做几点思考:
将没有.mdi文件的文件排序到“missing mdi”文件夹
我用过distutils.dir\u util。复制树是因为shutil.copytree公司acces有问题src = raw_input("Enter source disk location: ")
src = os.path.abspath(src)
dst = raw_input("Enter first destination : ")
dst = os.path.abspath(dst)
dest = raw_input("Enter second destination : ")
dest = os.path.abspath(dest)
for dir, dirs, files in os.walk(src):
if any(f.endswith('.mdi') for f in files):
dirs[:] = [] # do not recurse into subdirectories
continue # ignore this directory
# do something with the files here, there are no .txt files.
files = [os.path.join(dir, f) for f in files]
print "files -->", files
for list in files:
print "list