def getScriptLocation ( ) : location = os . path . abspath ( "./" ) if __file__ . rfind ( "/" ) != - 1 : location = __file__ [ : __file__ . rfind ( "/" ) ] return location
python get the location of the script
Helper function to get the location of a Python file .
def getScriptLocation():
	"""Helper function to get the location of a Python file."""
	location = os.path.abspath("./")
	if __file__.rfind("/") != -1:
		location = __file__[:__file__.rfind("/")]
	return location