Class main:
a=(input("file name"))
b=(input("insert a word"))
archive.relacao(b,a)
Class archive:
def relacao(self,word,document):
t=doc.contsimple()[word]
Class main:
a=(input("file name"))
b=(input("insert a word"))
archive.relacao(b,a)
Class archive:
def relacao(self,word,document):
t=document.contsimple()[word]
好吧,有几件事会导致这个错误:
确保在使用前定义
doc
。Python是一种解释语言,因此如果
语句是在您定义一些
doc
对象之前,Python会对此抱怨。在你是说
document
而不是doc函数
relacao
正在接收一个document
参数,因此可能您键入了doc
变量。 更改:收件人:
如果你这样做有效吗?在
因为这一点在我看来立竿见影-存档.relacao传递文件名,它采用
document
。但是document
没有使用-doc
被使用。doc
未定义,因此出现名称错误。在相关问题 更多 >
编程相关推荐