OSError: [Errno 22] Invalid argument:
来源:互联网 发布:淘宝现代热水器怎么样 编辑:程序博客网 时间:2024/06/10 21:32
Python读文件操作报错
>>> infile=open("C:\number.txt","r")
File "<pyshell#15>", line 1, in <module>
infile=open("C:\number.txt","r")
OSError: [Errno 22] Invalid argument: 'C:\number.txt'
>>> infile=open("C:\number.txt","r")
1:如果确认目录下有该文件时,注意将这里的文件扩展名打上对勾
2:open函数定义<variable>=open(<name>,<mode>)
在此处,name为磁盘文件名
格式应为路径+文件名+后缀。例如d:/abc.exe ‘d:/’为盘符,‘abc’为文件名,‘.exe’就是后缀。
所以 infile=open("C:\number.txt","r")
应该改为infile=open("c:/number.txt","r")
同时应该把隐藏后缀名打上勾
阅读全文
0 0
- OSError: [Errno 22] Invalid argument:
- python打开文件报错OSError: [Errno 22] Invalid argument:
- setsockopt invalid argument,errno 22
- 在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: ‘文件路径’
- OSError: [WinError 10022] An invalid argument was supplied
- pefile under python 2.4 (centos os ) EnvironmentError: [Errno 22] Invalid argument
- 错误代码: 1017 Can't find file: '.\bus\t_driver_info@ff1b.frm' (errno: 22 - Invalid argument)
- shmget创建共享内存errno=22,Invalid argument错误问题
- sendto 返回-1,errno为22,invalid argument的解决办法,mark一下
- python3 使用pyaudio OSError: [Errno -9996] Invalid input device (no default output device)-ubuntu16.04
- invalid argument
- eclipse termios.error: (22, 'Invalid argument')
- OSError:[Errno 13]Permission denied解决方法
- OSError: [Errno 1] Operation not permitted
- OSError: [Errno 11] Resource temporarily unavailable
- OSError: [Errno 1] Operation not permitted
- “except (IOError, OSError), e: SyntaxError: invalid syntax”
- accept: Invalid argument
- JavaScript小功能
- nohup 用法
- PHP实现分页浏览功能
- SQL语句的基本语法
- Python 实现神经网络逆向传播算法(含详细注释)
- OSError: [Errno 22] Invalid argument:
- C语言实现单链表面试题--进阶
- Apache开启GZIP压缩
- Android内存共享、进程间高性能IO、手动实现 Binder IPC、Aidl例子
- SpringMvc @RequestParam注解全面解析
- HTML小功能
- SpringMVC的Date与String互转
- 单链表快速排序
- Alice and Bob