test_import_file.py,在当前目录
import sys sys.path.append("..") import hello hello.printHello()
hello.py,在上一个目录
def printHello(): print("hello world !")
python之文件调用
原文:http://www.cnblogs.com/thinkers-dym/p/7001072.html