python之文件调用

test_import_file.py,在当前目录

import sys
sys.path.append("..")

import hello

hello.printHello()

hello.py,在上一个目录

def printHello():

    print("hello world !")
原文地址:https://www.cnblogs.com/thinkers-dym/p/7001072.html