for r, d, f in os.walk('slave1'):
    for files in f:
        filepath = os.path.join(os.getcwd(), 'slave1', 'slave', files)
destpath = os.path.join(os.getcwd(), 'slave1')
shutil.copy(filepath, destpath)
shutil.rmtree(os.path.join(os.getcwd(), 'slave1', 'slave'))
Move child folder contents to parent folder in python