Good morning everyone!I've been working on a script that is supposed to automate a task, and I currently split up all of the steps into their own tools. The issue that I'm having is when I try and run the script tool in ArcGIS. Currently it works fine in the command line, but when I load the script tool into a Toolbox in Arc, it seems to just go past the subprocess calls without actually doing them. It looks like it is trying to spawn off a seperate python process (Task Manager shows that there is a python.exe running when the script starts) but it closes quickly. I use the python "subprocess" module (the .call function) to call each file, but I have also used the obsolete "os.system" call with no effect. I have also tried to set a return value to the subprocess call to try and halt the program from going further until the program has returned a value, but that has not helped either. I've also tried checking and unchecking "Run in Process" for the script too, and to no avail. The only thing that starts when I don't run the script in process is another instance of PythonWin, and it quits soon after.In my programs I have used os.system to call some .aml files that I have created, and those work fine when only running one tool. But I believe the issue must be with calling multiple files in this script.My question can be simplified to just this: How do you call other script tools (python files) inside of a script, and how do you make sure that the second process will wait for the first process to complete before it continues?Here is a snippet of the code that I am using, I won't post the whole thing because the other steps are the same format as this one, just different filenames and parameters.subprocess.call ( "python " + pypath + "\\ThiessenCatchments.py " + gp.workspace )
Thank you for your time, and if you need any additional information, I will more than likely be glad to oblige!