uengine-runner/RemovePycacheFile.py

14 lines
404 B
Python
Raw Normal View History

2022-12-18 18:00:19 +08:00
#!/usr/bin/env python3
import os
def Remove(path):
for i in os.listdir(path):
nowPath = f"{path}/{i}"
if os.path.isdir(nowPath):
if i == "__pycache__":
os.system(f"rm -rfv '{nowPath}'")
else:
Remove(nowPath)
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
2023-03-11 11:45:19 +08:00
debPath = f"{programPath}/"
Remove(debPath)