更新时间:2023-10-20 15:27:34
Per the great Dive进入Python:
Per the great Dive Into Python:
import sys, os
print 'sys.argv[0] =', sys.argv[0] 1
pathname = os.path.dirname(sys.argv[0]) 2
print 'path =', pathname
print 'full path =', os.path.abspath(pathname)