def mv(src_path, dest_path):
 try:
  os.rename(src_path, dest_path)
 except OSError:
  os.remove(dest_path)
  os.rename(src_path, dest_path)

def mv ( src_path , dest_path ) : try : os . rename ( src_path , dest_path ) except OSError : os . remove ( dest_path ) os . rename ( src_path , dest_path )
a shell-like mv .