我试图使用python向todoist添加一个经常性的任务。
我在下面尝试过,但不知道如何指定重复的设置
from pytodoist import todoist
user = todoist.login('login', 'pass')
project = user.get_project('my_project')
task = project.add_task('My Recuring task')
task = project.add_task('My Recuring task tomorrow at 2 pm')发布于 2017-11-27 18:01:34
我建议你使用我们的主图书馆。
下面是一条为每天创建新任务的单行命令:
python2.7 -c "import todoist; import os; token = os.environ.get('token'); api = todoist.TodoistAPI(token); api.items.add('test', None, date_string='ev day'); api.commit()"把它拆开:
# import the library
import todoist
# retrieve the token from my environment variables
import os
token = os.environ.get('token');
# initialize the API object
api = todoist.TodoistAPI(token)
# Create a new task called "test", with "None" as the project id and date_string as kwargs for the arguments of the item.
api.items.add('test', None, date_string='ev day')
# commit it! :)
api.commit()"在最后一个参数中,可以传递所有参数以命令参数的形式在文档中获得。
https://stackoverflow.com/questions/47491608
复制相似问题