python问题
在c里面调用d.py的d函数,为什么会把函数方法外的print打印出来啊。不应该只调用方法缩进后的的内容吗
d.py
print("这个不是函数d的啊")
def d():
print("d")
print("d")
print("这个不是函数d的啊")
d()
def e():
print("e")
c.py
def c():
print("c")
#一组办法
import testPage2.d
testPage2.d.d()
#另一组办法
from testPage2.d import d,e
d()
e()
调用结果
G:\pythonObject\venv\Scripts\python.exe G:/pythonObject/testPage2/c.py
这个不是函数d的啊
这个不是函数d的啊
d
d
Process finished with exit code 0
不应该是只有
d
d
这个嘛