【发布时间】:2020-12-04 15:23:32
【问题描述】:
我有一个类,它在他的一个函数中从我创建的另一个文件中调用另一个函数:
import test
class myclass:
...
def mainfunc(self):
test.myfunc()
...
start = myclass()
start.mainfunc()
但它给了我这个错误:
AttributeError: 模块 'test' 没有属性 'myfunc'
而且我不知道它为什么不调用它,即使是我正在使用它的编辑器也会自动为我完成该功能。
我该如何解决这个问题?
【问题讨论】:
-
请提供一些关于
test的信息
标签: python python-3.x