IOError:[Errno 22] invalid mode('wb')or filename: [英] IOError: [Errno 22] invalid mode ('wb') or filename:

查看:1936
本文介绍了IOError:[Errno 22] invalid mode('wb')or filename:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到以下错误。

  IOError:[Errno 22] invalid mode('wb')or filename:'C:\\Users\ \\病毒Patel \ \\ Documents \\\GitHub\\3DPhotovoltaics\\\Data_Output\\Simulation_Data\\\Raw_Data\\\Raw_Simulation_Data_2014-03-24 17:21:20.545000.csv '

我认为这是由于文件名末尾的时间戳造成的。任何想法?

解决方案

您不能在Windows文件名中使用 命名文件,路径和命名空间;它是保留字符之一:



  • 以下保留字符:




  • < (小于)
  • (大于)

  • (冒号) $ b
  • (双引号)
  • / 斜杠)
    $ \ (反斜杠)
  • | (竖线或竖线)
  • (问号)
  • * (星号)




不要在保留字符列表中使用不同的字符。


I keep getting the following error.

IOError: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\Viral Patel\\Documents\\GitHub\\3DPhotovoltaics\\Data_Output\\Simulation_Data\\Raw_Data\\Raw_Simulation_Data_2014-03-24 17:21:20.545000.csv'

I think it is due to the timestamp at the end of the filename. Any ideas?

解决方案

You cannot use : in Windows filenames, see Naming Files, Paths, and Namespaces ; it is one of the reserved characters:

  • The following reserved characters:

    • < (less than)
    • > (greater than)
    • : (colon)
    • " (double quote)
    • / (forward slash)
    • \ (backslash)
    • | (vertical bar or pipe)
    • ? (question mark)
    • * (asterisk)

Use a different character not on the reserved character list.

这篇关于IOError:[Errno 22] invalid mode('wb')or filename:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆