Hello. I have currently a few scripts that I want to run as always-on tasks or scheduled tasks. However, they need .txt files to work, so they keep sending error messages in the task console.
How do I deal with this?
Hello. I have currently a few scripts that I want to run as always-on tasks or scheduled tasks. However, they need .txt files to work, so they keep sending error messages in the task console.
How do I deal with this?
How .txt files are not working for you? If you have some logging in your tasks it will be automatically put into the task log file.
here is the error message:
Jan 28 12:03:54 text_file = open("listadenomes.txt", "r",encoding='Latin-1') #We open the list of words
Jan 28 12:03:54 FileNotFoundError: [Errno 2] No such file or directory: 'listadenomes.txt'
I uploaded the file to this service and, when using consoles, the script works perfectly (until it inevitably stops).
[edit by admin: formatting]
When you open a file using a relative path like "listadenomes.txt"
, it will look for the file in the process's current working directory, which is not the same thing as the directory where your script is stored. You'll need to use an absolute path to specify exactly which directory the file is in; this help page has the details.