Python 3.4 open(file, 'a') aifc.Error
-
02-01-2020 - |
题
我正在使用 Netbeans 编写 python,我有了它,这样我就可以附加一个文件(在 Eclipse 中) file = open('dir\file', 'a')
所以我可以附加一个文件,但我得到这个:
aifc.Error: mode must be 'r', 'rb', 'w', or 'wb'
我不想读取文件,保存到数组或临时文件,然后重写。这是怎么回事?
笔记:我在命令提示符中得到了同样的结果,这对我来说似乎很奇怪。
另外,我知道我的解释器配置正确,所有内容都在 python34 文件夹中(即 python34\Lib\site-packages
)
运行时的完整错误消息:
Running...
Traceback (most recent call last):
File "G:\Prog\PythonCurrent\RadioDB\src\radiodb.py", line 122, in <module>
main()
File "G:\Prog\PythonCurrent\RadioDB\src\radiodb.py", line 43, in main
lineTypesFile = open('{}/Desktop/GPS Line Types.txt'.format(home), 'a')
File "c:\Python34\lib\aifc.py", line 891, in open
raise Error("mode must be 'r', 'rb', 'w', or 'wb'")
aifc.Error: mode must be 'r', 'rb', 'w', or 'wb'
不隶属于 StackOverflow