os.chdir(os.path.abspath(os.path.dirname(sys.argv[0]))) 转载于:https://www.cnblogs.com/vanwoos/p/8143418.html