1stAmerican

Calling Script within a Script - Passing Parameters From Parent to Child

Discussion created by 1stAmerican on Feb 18, 2011
Latest reply on Feb 24, 2011 by csny490
I'm creating a "Script Manager" that will consolidate scripts that have common parameters. The "Script Manager" will call on Child scripts, pass parameters to Child, and export out pdf's.
I believe my syntax is correct but have 2 issues, neither of which generate an error.
Parameters do not pass to the child and pdf's are not created.
Even if the parameter is not passed, the pdf should still export to a blank .pdf of the mxd.

Does anyone see what is wrong???
import arcpy, os
import subprocess
import sys
arcpy.env.overwriteOutput = True

sqlRecord = arcpy.GetParameterAsText(0)
Territory = arcpy.GetParameterAsText(1)

if Territory == "One":
os.system('python C:\Temp\One.py ' + sqlRecord)
elif Territory == "Two":
os.system('python two.py' + sqlRecord)

Thank you in advance, Aaron

Outcomes