(source, dest)
Similarly to the UNIX mv command, moves / renames source_file in
        dest (if dest is a file name) otherwise moves source_file in
        the directory dest
Similarly to the UNIX mv command, moves / renames source_file in
        dest (if dest is a file name) otherwise moves source_file in
        the directory dest
Similarly to the UNIX mv command moves / renames source_file in dest ( if dest is a file name ) otherwise moves source_file in the directory dest
def mv(source, dest):
        """Similarly to the UNIX mv command, moves / renames source_file in
        dest (if dest is a file name) otherwise moves source_file in
        the directory dest
        """
        if os.path.isdir(dest):
            dest = os.path.join(dest, os.path.basename(source))

        if os.path.isdir(source):
            if os.path.exists(dest):
                if os.path.isdir(dest):
                    shutil.rmtree(dest, ignore_errors=True)
                else:
                    os.unlink(dest)
            shutil.copytree(source, dest, symlinks=True)
            shutil.rmtree(source, ignore_errors=True)
        else:
            shutil.copy(source, dest)
            os.unlink(source)
def mv ( source , dest ) : if os . path . isdir ( dest ) : dest = os . path . join ( dest , os . path . basename ( source ) ) if os . path . isdir ( source ) : if os . path . exists ( dest ) : if os . path . isdir ( dest ) : shutil . rmtree ( dest , ignore_errors = True ) else : os . unlink ( dest ) shutil . copytree ( source , dest , symlinks = True ) shutil . rmtree ( source , ignore_errors = True ) else : shutil . copy ( source , dest ) os . unlink ( source )