Trying to run bot in server. Ubuntu 20.1
Line in code(Python3)
...
for elem in items['stats']:
f = open(r"\root\bot_python\list.txt", "r+")
...
Traceback
Traceback (most recent call last):
File "bot_last_final_18_01_2021.py", line 57, in <module>
f = open(r"\root\bot_python\list.txt", "r+")
FileNotFoundError: [Errno 2] No such file or directory: '\\root\\bot_python\\list.txt'
How correctly write directoty?
r+
) mode and the file doesn't exists so you get theFileNotFound
error as expected. To create a new file and write contents to it, you need to open it in write mode.\root\bot_python\list.txt
in read mode? Doeslist.txt
exist in the `\root\bot_python` directory?