相关疑难解决方法(0)

AttributeError:'module'对象没有属性

我有两个python模块:

a.py

import b

def hello():
  print "hello"

print "a.py"
print hello()
print b.hi()
Run Code Online (Sandbox Code Playgroud)

b.py

import a

def hi():
  print "hi"
Run Code Online (Sandbox Code Playgroud)

当我跑步时a.py,我得到:

AttributeError: 'module' object has no attribute 'hi'
Run Code Online (Sandbox Code Playgroud)

错误是什么意思?我如何解决它?

python attributeerror

178
推荐指数
9
解决办法
55万
查看次数

标签 统计

attributeerror ×1

python ×1