This code:
class Todo:
def addto(self, list_name="", text=""):
"""
Adds an item to the specified list.
"""
if list_name == "":
list_name = sys.argv[2]
text = ''.join(sys.argv[3:]
todo_list = TodoList(getListFilename(list_name))
produces a syntax error with the little arrow pointing to todo_list
on the last line.
The __init__
method for TodoList
is here:
def __init__(self, json_location):
"""
Sets up the list.
"""
self.json_location = json_location
self.load()
I am kind of new to Python, so I don't see what I am doing wrong here.