Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using this this bit of code to execute a FME Workbench file through a Python script ...

import os
os.system("fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw")

However, when I try using it as an ArcGIS script tool, ArcGIS tries to execute it using the Data Interop's fme.exe. I only have the stand alone version of FME. I tried using the full path to the fme.exe i'm trying to use, but that's not working ( the script runs without error, but nothing is produced). Any ideas on how to get this script to work, using the stand alone version of FME, as an ArcGIS script tool?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

This worked for me. Apparently the os.system module is being replaced by the subprocess module. Here is the documentation.

import subprocess
subprocess.Popen(['C:\\Program Files\\FME\\fme.exe', 'P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw'])

This now works within an ArcGIS script tool.

share|improve this answer

Not sure why the full path isn't working, unless you aren't escaping backslashes maybe? I would think the full path should work just fine. Maybe post that code as well. Another option would be to setup the path to fme.exe as an Environmental Variable, so add the path, something like C:\Program Files\FME\path\to\fme.exe as a environmental variable.

share|improve this answer
    
Using this ... "C:\\Program Files\\FME\\fme.exe P:\\Mapping\\Scripts\\FME\\Easements_ROW_Extract_From_CAD.fmw" –  dchaboya Dec 10 '12 at 17:14
    
See this as well: gis.stackexchange.com/a/19141/65 –  Chad Cooper Dec 10 '12 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.