Python 基礎(chǔ)教程
Python 內(nèi)置函數(shù)
execfile() 函數(shù)可以用來(lái)執(zhí)行一個(gè)文件。
以下是 execfile() 方法的語(yǔ)法:
execfile(filename[, globals[, locals]])
返回表達(dá)式執(zhí)行結(jié)果。
以下展示了使用 execfile 函數(shù)的實(shí)例:
假設(shè)文件 hello.py,內(nèi)容如下:
print('json');