How do I delete a file or folder in Python?
shutil.rmtree is the asynchronous function, so if you want to check when it complete, you can use while...loop
import os import shutil shutil.rmtree(path) while os.path.exists(path): pass print('done')