import arcgisscriptingthis turns out not to work, because behind the scenes somewhere the GIS processing object is playing silly-buggers with stdout, so print doesn't work like it should. You can force stdout to be 'normal' by doing something like this:
gp = arcgisscripting.create(9.3)
tools = gp.ListTools("*")
for tool in tools:
....print(gp.Usage(tool))
import arcgisscripting
oldstdout = sys.stdout
gp = arcgisscripting.create(9.3)
#this call to ListTools has the undocumented strange
#side-effect of changing sys.stdout
tools = gp.ListTools("*")
gp_stdout=sys.stdout
for tool in tools:
....usagestr=gp.Usage(tool)
....sys.stdout=oldstdout
....print(usagestr)
I hope this isnt a sign of what I'm in for while learning this stuff -- stange undocumented behind-the-scenes funny-business.
No comments:
Post a Comment