1. 程式人生 > >python之文件調用

python之文件調用

color clas print .py cnblogs pat div class sys

test_import_file.py,在當前目錄

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

import hello

hello.printHello()

hello.py,在上一個目錄

def printHello():

    print("hello world !")

python之文件調用