gserbin

How do I get a Python script to execute another Python script from ArcMap?

Discussion created by gserbin on Jun 7, 2012
Latest reply on Jun 7, 2012 by mahunter243
Greetings,

I wrote a Python 2.6 script which calls another two Python scripts to help with my workflow.  They work great when I run them from Komodo IDE, but the adapted version of the main script fails to execute the other two scripts when run from ArcGIS 10.0.  The code is as follows:

import os

command = 'Y:/scripts/import_landsat_RGB.py' 
os.path.normcase(os.path.normpath(command))
outargs =command+' '+j[4]+' '+outpath
fi, foe = os.popen4(outargs) 


After viewing various posts here I tried this to no avail:

import os

command = 'Y:/scripts/import_landsat_RGB.py' 
os.path.normcase(os.path.normpath(command))
pyexe = 'D:/Python26/ArcGIS10.0/python.exe'
os.path.normcase(os.path.normpath(pyexe))
outargs =pyexe+' '+command+' '+j[4]+' '+outpath
fi, foe = os.popen4(outargs)


Anyone know what I am doing wrong?

Thanks,
Guy

Outcomes