Hi All,
From inside the ToolValidator in a script tool, is there a way to determine the path of the script to which a script tool is pointing?
I'd like to set the default value of an input data file based on its relative path to the script. An acceptable alternative for me would be to detect the location of the toolbox containing the script tool. But the following return empty strings inside the ToolValidator class:
Thanks!
From inside the ToolValidator in a script tool, is there a way to determine the path of the script to which a script tool is pointing?
I'd like to set the default value of an input data file based on its relative path to the script. An acceptable alternative for me would be to detect the location of the toolbox containing the script tool. But the following return empty strings inside the ToolValidator class:
Code:
os.getcwd
sys.argv[0]
os.path.abspath(__file__)
inspect.getfile(inspect.currentframe())