>>> import os
>>> homedir = os.getcwd()>>> print homedirD:\python\test>>>>>> import sys>>> print sys.argv[0]D:\python\test\temp.py>>> print os.path.abspath(sys.argv[0])D:\python\test\temp.py>>>本文共 202 字,大约阅读时间需要 1 分钟。
>>> import os
>>> homedir = os.getcwd()>>> print homedirD:\python\test>>>>>> import sys>>> print sys.argv[0]D:\python\test\temp.py>>> print os.path.abspath(sys.argv[0])D:\python\test\temp.py>>>转载地址:http://rmzta.baihongyu.com/