Question: How do I delete a file or folder?

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

```
I recommend using `subprocess` if writing a beautiful and readable code is your cup of tea:

```
import subprocess
subprocess.Popen("rm -r my_dir", shell=True)

```

And if you are not a software engineer, then maybe consider using Jupyter; you can simply type bash commands:

```
!rm -r my_dir

```

Traditionally, you use `shutil`:

```
import shutil
shutil.rmtree(my_dir) 

```