📅  最后修改于: 2022-03-11 14:46:03.283000             🧑  作者: Mango
import os
path = 'a/relative/file/path/to/this/script/file.txt'
with open(os.path.join(os.path.dirname(__file__), path), 'r') as input_file:
content = input_file.read()