10 Answers
New AnswerIn my version of python, mustn't to create a file using "open(test.xml, "w")", there will be an exception. If the file was created in advance, then there will be no exception.
4/14/2021 4:41:10 PM
Operand10 Answers
New AnswerIf your operating system is POSIX-compliant then you can issue a shell command to create it by using "touch": import os os.system("touch test.xml") If the file does not exist, then it will create the file. Else it will update the access and modification date and time stamps of the existing file. See the man page for options to change its behavior.
Operand , very difficult to guess what are you doing in your code. it would be helpful, if you could show us your code. please put it in playground and link it here. thanks!
What do you mean in advanced? Function open(test.xml,"w") create file test.xml for write then you need close this file.
Hmm, it is harder... And what about implement https://realpython.com/python-requests/
Václav Dostál What will it change? The problem is in creating the file, because the exception clearly states that this directory does not exist.
There Is from ... import exception And May by it shows error. But try as Brian wrote /downloads/.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message