使用“从主导入x”时出现Python属性错误

使用“从主导入x”时出现Python属性错误,python,function,import,module,attributeerror,Python,Function,Import,Module,Attributeerror,所以我有两个文件:main.py文件和debugModule.py文件。debugModule.py文件有一个名为Debug()的类。这个类有一个方法,update(),我想在main.py中使用它。我该怎么做 我主要使用import debugModule,debug=debugModule.debug(),然后使用debug.update()来执行此方法,但这只会引发一个错误: File "C:\Users\Nisse\workspace\Platformer\src\main.py", l

所以我有两个文件:main.py文件和debugModule.py文件。debugModule.py文件有一个名为
Debug()
的类。这个类有一个方法,
update()
,我想在main.py中使用它。我该怎么做

我主要使用
import debugModule
debug=debugModule.debug()
,然后使用
debug.update()
来执行此方法,但这只会引发一个错误:

File "C:\Users\Nisse\workspace\Platformer\src\main.py", line 5, in <module>
debug = debugModule.Debug()
AttributeError: 'module' object has no attribute 'Debug'
文件“C:\Users\Nisse\workspace\Platformer\src\main.py”,第5行,在
debug=debugModule.debug()
AttributeError:“模块”对象没有“调试”属性
我环顾四周寻找答案,但无法找到答案

如何使用main.py中其他模块的函数?
编辑:原来我把名字全弄乱了。再次编辑,现在它们是正确的。

是否导入
main
?什么是
debugModule
?它是否与
debugValues
相同?
debugValues
确实从
main
导入了一些变量,是的
debugModule
是.py文件,
debugValues
是一个类“
debugValues
是一个类”和“
import debugValues
”之间似乎存在矛盾。哦,糟糕,抱歉。我正在使用
导入调试模块
。我想我已经做得太久了,哈哈。我现在就编辑它。