Python 3 example

81 views
Skip to first unread message

tbc

unread,
Feb 17, 2019, 7:02:47 PM2/17/19
to Google Tasks Import
Importing the task list into a Python program was not obvious to me. I figured it out, though. Here's how to do it:
import pprint

pp
= pprint.PrettyPrinter(indent=4)
src
= "tasks.py"
# compile signature found at https://stackoverflow.com/questions/714881/how-to-include-external-python-code-to-use-in-other-files/16604453#comment69549307_16604453

exec(compile(source=open(src).read(), filename=src, mode='exec'))

pp
.pprint(tasklists)

Reply all
Reply to author
Forward
0 new messages