Traceback (most recent call last): File "E:\PythonDemo\com\song\pizza_test.py", line 7, in <module> p.show_hello() AttributeError: module 'pizza' has no attribute 'show_hello'
将模块所属的包设置为 source
import pizza as p # pizza.make_pizza(16, 'chocolate') # pizza.make_pizza(20, 'green pepper', 'extra cheese') p.show_hello()