import os import sys pwd=os.path.dirname(os.path.realpath(sys.argv[0])) pwd=sys.path[0] pwd=os.getcwd() 三者是有区别的