Let me rephrase my previous question. I just created a tool in ArcGIS using pythong as script language. The tool executes (runs) an outside program using the subprocess.popen. When I run the tool from ArcGSIS, a window appears that only shows the following.
Executing: RunFLOW C:\FLOW C:\FLOW\FLW.bat
Start Time: Mon Nov 30 16:50:37 2009
Running script RunFLOW...
Completed script RuFLOW...
Executed (RunFLOW) successfully.
End Time: Mon Nov 30 16:50:48 2009 (Elapsed Time: 11.00 seconds)
The script is as follows
# Import system modules
import sys, string, os, arcgisscripting, subprocess
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Read the parameter values:
# 1: input workspace
prj_fld = gp.GetParameterAsText(0)
Flow_bat = gp.GetParameterAsText(1)
os.chdir(prj_fld)
p=subprocess.Popen(Flow_bat,shell=True,stdout=subprocess.PIPE)
stdout_value = p.communicate()[0]
print '\tstdout:', repr(stdout_value)
When I run the same program from command window, it prints a screen full of information (date, number of iteration, etc.). I want to see all this information in the window that appears after I run the model from ArcGIS in addition to what it is being printing right now. I tried print, communicate, flush but couldn't be able to do it. Any suggestions?
When I run the script as it is right now, it runs the executable but it gives an error as follows
ERROR 999998: There are no more files.
Thanks