我正在尝试使用AfterTheDeadline
API读取程序的某些输出。这是我的测试人员代码:
ATD.setDefaultKey('qg2324242424')
errors = list(ATD.checkDocument("Looking too the wter. Fixing your writing typoss."))
print(errors)
for error in errors:
print("%s error for: %s **%s**" % (error.type, error.precontext, error.string))
print("some suggestions: %s" % (", ".join(error.suggestions),))
我将list()
放在ATD.checkDocument
之前,因为否则它只会返回一个生成器对象。错误只是一个空列表,因此for循环不返回任何内容。我正在使用Miguel Ventura's python 3+ version运行我的代码。任何有关如何获得预期输出的帮助将不胜感激。