python不同文件夹中模块的引用调用顺序,被调用的模块中①有类的 模块.类().方法() ②无类的:模块.方法()
test包中testIm.py 调用 test1包中testIm1.py中的方法craw1()方法,输出结果:
testIm.py
# coding:utf-8
# testIm.py位于test包中,要调用test1包中的testIm1.py中的方法craw1()方法
import sys sys.path.append('C:\\pythonwork\\test1') #加入路径,添加目录
# print sys.path import