os模块: path=os.path.join(os.path.dirname(os.path.dirname(__file__)),'images') path:运行脚本的当前文件下的上一个文件的地址+images os.path.dirname(__file__) 脚本是以完整路径被运行的, 那么将输出该脚本所在的完整路径,比如: python d:/pythonSrc/test/test.py 那么将输出 d:/pythonSrc/test 脚本是以相对路径被运行的, 那么将输出空目录,比…