def rm_r(path):
 if os.path.isdir(path):
  shutil.rmtree(path)
 elif os.path.isfile(path):
  unlink(path)

def rm_r ( path ) : if os . path . isdir ( path ) : shutil . rmtree ( path ) elif os . path . isfile ( path ) : unlink ( path )
like rm -r command .