Python - os.rename() - OSError: [WinError 123]

前端 未结 2 937
执念已碎
执念已碎 2020-12-12 02:02
path=\'U:\\\\rmarshall\\Work For Staff\\\\ROB\\\\_Downloads Folder\\\\\'
file=\'file.pdf\'
newFileName=time.strftime(\'%Y-%m-%d_\')+row[1]+time.strftime(\'_%H:%M:%S\         


        
相关标签:
2条回答
  • 2020-12-12 02:32

    The colon : is not allowed in Windows file names.

    See Naming Files, Paths, and Namespaces on MSDN

    0 讨论(0)
  • 2020-12-12 02:32

    the error is due to the fact that windows doesn not support charcter "" in the names. Your shuld modify this by replacing "\n" with "".

    0 讨论(0)
提交回复
热议问题