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最后一行。

__init__方法在TodoList这里:

def __init__(self, json_location):
    """
    Sets up the list.
    """
    self.json_location = json_location
    self.load()

我对 Python 有点陌生,所以我看不出我在这里做错了什么。

4

1 回答 1

11

你需要关闭它)

text = ''.join(sys.argv[3:]
于 2009-12-23T21:35:35.870 回答