Forums

Python Notebook Returning Code 0 Files Not Getting Written

Hi

I have scheduled a job using Tasks and while the job runs successfully (returns code 0) it does not write the required files.

I wondered if it was an issue with the complexity of my code so ran a super simple file that installs pandas, makes a tiny data frame from a list and writes that and I have the same problem. Both pieces of code run fine and write the requisite files when triggered manually.

My file path format is

python3.10 /home/katesherrard13/Notebook3.ipynb

Any help appreciated :)

Make sure you know where the files are being written: https://help.pythonanywhere.com/pages/NoSuchFileOrDirectory/

Thanks Glenn - would that still be an issue when it's writing fine from the script itself and an issue when executing via schedule, as I can't see anything obviously incorrect?

My write pathways are in the following format:

dfStock.to_csv(f'/home/katesherrard13/ccuk/finalfiles/masterfiles/stock.csv')

If that path is not writing the file, then the issue is somewhere else in your code. Perhaps the part of the code that writes the file is being skipped for some reason.