My main issue is that I'm trying to launch a Python script (I used #!/usr/local/bin/python3
at the top, changed it to .command file, and made sure to run chmod +x
) which uses a module (ezsheets) that references a specific folder for authentication, but I can't get it to automatically run as when I launch the script it references the home folder.
More specifically, I have a script in a folder called spreadsheets, and inside that folder I have the appropriate Google account permissions file. I store all my spreadsheet altering files in there as it seems EZsheets requires that in order to verify authentication.
However, when I run it as a .command file, I believe the issue is that it opens my Terminal in the home folder and then runs the script, and I get the following error:
raise EZSheetsException(
ezsheets.EZSheetsException: Can't find credentials file at /Users/myusername/credentials-sheets.json
It can't find it, because that's located in /username/documents/spreadsheets
.
When I am in the right directory in terminal and run the file manually, it works just fine.
Ideally I'd like to be able to launch this script from /spreadsheets
and leave all my spreadsheet scripts in there as that has the permission file that I've already authenticated - is there any way to launch the script that executes starting from /username/documents/spreadsheets
instead of the default home folder?