Pythonista Excel Query


After a bit of help if possible and I fully appreciate it is a newbie question but I am just trying to learn python at the same time and finally have a use case to try to work with.

Ultimately what I want to do is have the facility to save a number that I type in for example 25 to a new line in an excel spreadsheet in Pythonista. The idea being once I have numerous numbers saved I can then use the data to provide trends etc etc.

I also need it to ideally save the time and date.

So teh first step I did was checked its possible in Pythonista and it looks like it is through openpyxl so have that under import at the top of the script. The immediate problem I am facing is that it can’t open the file as the file is in my main iCloud Drive rather than the Pythonista scripts folder and for some reason it won’t allow me to move it.

Not looking for someone to solve the whole problem as I am looking to learn from it but I am completely stuck with what directory to point to in the script to open the excel sheet - can anyone help?

There will likely be loads more questions as I try to figure out the next bits…


Have you considered just using a .csv file rather than a full excel file? CSV is just plaint text and far easier to manipulate with automation tools.

Hi thanks for the response. No issue with it being CSV, can then use the info into Excel and do it as two parts, unfortunately still has the same issue in terms of the file path, I was just thinking straight to excel would cut out a step.

If there is a way to get the file sorted then happy to do it in CSV.

Access to Files outside an app’s sandbox on iOS is limited. I use Scriptable’s bookmarking feature to get around this. Alternatively, you could store the file elsewhere.

Thanks again, I’ll look into the bookmarking element. I couldn’t see how I could store it elsewhere and link to it, my original plan was my documents folder in iCloud but couldn’t get it to see the file to open it.