Question: How do I delete a file or folder?

Answer: 
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')

```
To remove all files in folder

```
import os
import glob

files = glob.glob(os.path.join('path/to/folder/*'))
files = glob.glob(os.path.join('path/to/folder/*.csv')) // It will give all csv files in folder
for file in files:
    os.remove(file)

```

To remove all folders in a directory

```
from shutil import rmtree
import os

// os.path.join()  # current working directory.

for dirct in os.listdir(os.path.join('path/to/folder')):
    rmtree(os.path.join('path/to/folder',dirct))

```