python报错 OSError: [Errno 22] Invalid argument

问题

Windows下,以w的模式打开文件报错
  OSError: [Errno 22] Invalid argument: ‘D:\TSSD-OTA-tssd-ota\weights\test\Mar_02_10:34:12_2019.log’

错误原因:

windows下文件的命名规范
  文件名不允许使用的字符有: < > / \ | : " * ?

猜你喜欢

转载自blog.csdn.net/qq_44167992/article/details/88073321
今日推荐