Forums

Pickle file not being created when run by scheduled task

I wrote this script which creates a pickle file to save a list for later use and the script works perfectly when I run it myself but when I set a scheduled task to run the script no pickle file is created even though the logs show that it ran successfully.

Is there something extra I need to put into my code for it to create the file when run via the scheduler?

Thank you in advance.

The file is probably being created, just not where you expect. Use an absolute file path to create the file so your code is not dependent on the working directory.

Hey glenn, thank you! You were right, it was created in the parent directory because I didn't specify.

glad you figured it out!