import os,sys print sys.argv[0] print os.path.dirname(sys.argv[0]) print os.path.abspath(os.path.dirname(sys.argv[0]))