我是 python 新手,现在正在学习如何导入模块或函数,但我收到了这些已发布的错误。python代码保存在名称下:hello_module.py
蟒蛇代码:
def hello_func():
print ("Hello, World!")
hello_func()
import hello_module
hello_module.hello_func()
错误信息:
Traceback (most recent call last):
File "C:/Python33/hello_module.py", line 9, in <module>
import hello_module
File "C:/Python33\hello_module.py", line 10, in <module>
hello_module.hello_func()
AttributeError: 'module' object has no attribute 'hello_func'