如何从导入的文件中调用函数?例如:
测试:
import test2
def aFunction():
print "hi there"
测试2:
import test
aFunction()
这给了我一个名称错误,说我的函数没有定义。我也试过:
from test import aFunction
和:
from test import *
我也尝试过不在测试中导入 test2。我从 C++ 开始使用 Python,所以我担心我错过了一些对于资深 Python 程序员来说显而易见的东西......