Python 3.4 Apri (file, 'A') AIFC.Error
-
02-01-2020 - |
Domanda
Sto usando NetBeans per scrivere Python, e l'ho avuto in modo che iopotrebbe aggiungere un file (in Eclipse) con file = open('dir\file', 'a')
in modo da poter aggiungere un file, ma ottengo questo:
aifc.Error: mode must be 'r', 'rb', 'w', or 'wb'
.
Non voglio dover leggere il file, salvare a file o file temp e quindi riscrivere.Cosa sta succedendo?
Nota: ottengo la stessa cosa nel prompt dei comandi, che mi sembra strano per me.
Inoltre, so che il mio interprete è configurato correttamente e tutto è nella cartella Python34 (cioè python34\Lib\site-packages
)
Messaggio di errore completo sulla corsa:
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'
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow