0
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))
产生一个语法错误与小箭头指向todo_list
的最后一行。
为TodoList
的__init__
方法是在这里:
def __init__(self, json_location):
"""
Sets up the list.
"""
self.json_location = json_location
self.load()
我是一种新的Python的,所以我没有看到我在做什么错在这里。
*史诗捂脸*。注意自我:解释器在定位语法错误时不是很准确。下次进行更详细的检查。 – Macha 2009-12-23 21:39:01
大声笑。这已经发生在我身上了几次;) – jbochi 2009-12-23 21:41:01
@Macha:其实,它是致命的准确定位语法错误。不要让你对前面代码行的假设包含你对错误信息的解释。声明 - 没有关闭'''可以继续,直到明确标识符丢失。 – 2009-12-23 22:57:30