import sys, os, arcpy #do checks... #Call child script: Message = child_Script( Input_GDB, Input_Feature_Class ) #Resume master script print Message
def child_Script( Input_GDB_Name, Input_Feature_Class_Name): try: import sys, string, os, shutil, time, traceback, arcpy #Have to import arcpy again!!!! import arcpy.sa # Doesn't work... module not found return "Finished!!" except: ...
Solved! Go to Solution.
import dataset_conversion, dataset_conversion27_83, dataset_conversion83_CSRS def func(): dataset_conversion.export() dataset_conversion27_83.conversion() dataset_conversion83_CSRS.conversion()
import arcpy, datetime, sys def export(): try: ...
import arcpy,testing_arcpy print testing_arcpy.test()
def test(): import arcpy import arcpy.sa arcpy.env.workspace = r"C:\GIS\testing" return arcpy.env.workspace
import arcpy.sa
from arcpy import sa
I have imported child scripts that call arcpy without any problems.
Are you sure by this lineimport arcpy.sa
You don't mean this?from arcpy import sa
import dataset_conversion, dataset_conversion27_83, dataset_conversion83_CSRS def func(): dataset_conversion.export() dataset_conversion27_83.conversion() dataset_conversion83_CSRS.conversion()
import arcpy, datetime, sys def export(): try: ...
import arcpy,testing_arcpy print testing_arcpy.test()
def test(): import arcpy import arcpy.sa arcpy.env.workspace = r"C:\GIS\testing" return arcpy.env.workspace
import sys, os, arcpy as arcpy0 ... Message = childScript( params...) arcpy0.AddMessage("Script Complete:\n" + Message)
def childScript( params...): try: import sys, string, os, shutil, time, traceback, arcpy ... outputRaster = arcpy.sa.ExtractByMask(hddRaster, Input_AOA_Feature_Class) print "Finished"