I created a Python script that uses the Todoist API to export my task list to a list of strings (I want to paste them as Discord messages) and it works fine if I run the command on the Terminal window, but if I run the same command using AppleScript, an error is thrown, saying No module named todoist.api
.
Here's the code: (I have only one line)
do shell script "$HOME/tasks.sh"
The shell scripts runs the python scripts I need, but the problem is in the imports of those files, which are:
from datetime import date, datetime, timedelta
from todoist.api import TodoistAPI
import pyperclip
import os
import MyTodoist
in the first file (tasks.py
) and
from datetime import date, datetime, timedelta
from todoist.api import TodoistAPI
import pyperclip
import os
in the second file (MyTodoist.py
)
The final goal is to store the result of a function in tasks.py
in a variable in my script, but I don't know how. Can someone help me please?