[英]Why is this a python syntax error during an initialisation?
这段代码:
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的新手,所以在这里看不到我做错了什么。
您需要关闭此)
text = ''.join(sys.argv[3:]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.