#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pathlib

import argparse

parser = argparse.ArgumentParser(description='Clean up a folder')
parser.add_argument('-p', dest='path', action='store', help='path of the folder')

args = parser.parse_args()

def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()

# usb = pathlib.Path('/Volumes/XINJI1501/')

cleanup(args.path)

82ee0b5b489e3a583330b97292b71be9527b730b
<mask token>


def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()


<mask token>

<mask token>
parser.add_argument('-p', dest='path', action='store', help=
    'path of the folder')
<mask token>


def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()


cleanup(args.path)

<mask token>
parser = argparse.ArgumentParser(description='Clean up a folder')
parser.add_argument('-p', dest='path', action='store', help=
    'path of the folder')
args = parser.parse_args()


def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()


cleanup(args.path)

import pathlib
import argparse
parser = argparse.ArgumentParser(description='Clean up a folder')
parser.add_argument('-p', dest='path', action='store', help=
    'path of the folder')
args = parser.parse_args()


def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()


cleanup(args.path)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import pathlib

import argparse

parser = argparse.ArgumentParser(description='Clean up a folder')
parser.add_argument('-p', dest='path', action='store', help='path of the folder')

args = parser.parse_args()

def cleanup(path):
    for p in path.iterdir():
        if p.is_file():
            p.unlink()
        elif p.is_dir():
            cleanup(p)
            p.rmdir()

# usb = pathlib.Path('/Volumes/XINJI1501/')

cleanup(args.path)
