Python - WindowsError: [Error 2] The system cannot find the file specified

前端 未结 4 1654
梦毁少年i
梦毁少年i 2020-12-21 19:49

I have a folder full of pdf files. I\'m trying to remove all the spaces from files name and replace them with underscores. Here\'s what I have so far:

import         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-21 19:59

    ...

    os.rename(os.path.join(folder, files), os.path.join(folder, NewName))
    

提交回复
热议问题