How do I get the path of the Python script I am running in? [duplicate]
7.2 of Dive Into Python: Finding the Path.
import sys, osprint('sys.argv[0] =', sys.argv[0]) pathname = os.path.dirname(sys.argv[0]) print('path =', pathname)print('full path =', os.path.abspath(pathname))