file print(__file__) __fiel__在代码执行时生成,其为代码 所在绝对路径 例如: 输入:python path_problem.py输出:path_problem.py 输入:python 3/path_problem.py输出:3/path_problem.py