1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
import os
def (path): if os.path.exists(path): for item in os.listdir(path): item = os.path.join(path, item) if os.path.isdir(item): func(item) else: os.remove(item) os.removedirs(path) else: raise TypeError("路径错误!")
path = input("请输入路径:") func(path)
|
近期评论