Sunday, 10 July 2016

arcpy - How to print log from FME when run from python script?



I created a Spatial ETL ToolBox in ArcCatalog. When I run the tool from ArcCatalog I see log massages. But when I run this tool from a python script, the logs do not print to the python console.


import arcpy
arcpy.ImportToolbox(r"c:\Toolbox123.tbx")
arcpy.SpatialETLTool(param1,param2,...)

How to print log from FME when running from python script?



Answer



not familiar with FME - but a search turned up some code that basically said


# echo log file to stdout
logFile = open(logFilename, 'r')

for line in logFile.readlines():
print line

from here. So what @mapperz may be alluding to is creating a log file - then grabbing the output and writing to the console.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...