Windowserror: [error 183] error and in Python os.raname () detailed explanation

When I used Python to iterate over files in a folder and rename them, the correct code sometimes incorrectly reported WindowsError[183].
【 183 】 — & gt; Indicates that a file cannot be created while it exists.

Os.rename (oldFilepath,newfilepath), this error is most likely because your new path newfilepath has duplicated a file in the current folder [183].
Solution: Find duplicate files named other, or give a non-duplicate name first, then os.rename(oldFilepath, newFilepath)
Get the name you want.
For a variety of WindowsError error code, can refer to the article: https://blog.csdn.net/qq_35221523/article/details/79214356

Read More: