Skip to main content
Archived

Use external editor for Python coding

Related products:FME Form

I've seen suggestions that an IDE should be added to FME Desktop. Sounds awful. More stuff that can break and in need of updates.

I do agree, however, that there is a need for better handling of scripts. So why not allowing the PythonCaller, and the startup and shutdown scripting features, as well as any future scripting features, to load external files? Yes, I know you can load external files as modules, but you still need to write a script in one of FME's editors for scripts to do so, and these are unaware of typos and such, as far as I know, that is.

I see before my eyes, a simple button that opens a dialog box in either of the current editors, a dialog box from which you could point to the external Python file and that would solve a whole lot. Then you would be able to write a script in your favorite IDE, have FME load the file and run it, edit the script some more, and have FME rerun the workbench, and you would never have to worry about syntax errors and such things (provided your IDE supports dealing with those).

This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

david_r
Evangelist
  • July 26, 2017

You can already get really close by importing your own module. Example from a PythonCaller

from mylib import myfeaturehandler def FeatureProcessor(feature): myfeaturehandler(feature)

Not much to write in FME :-)


  • Author
  • July 27, 2017
Yes, I know, and that's why I also wrote about it in my post.

 

Each to his/her own, but IMO, you shouldn't have to do that.

 

 


david_r
Evangelist
  • July 27, 2017

Sure, I understand and I agree that it would be a worthwhile addition, I'm just trying to demonstrate how close you can already get.

See the attached example where the PythonCaller has no code at all and the startup script has only two lines:

from externals import * Startup()

And the shutdown script has just a single line:

Shutdown()

They all reference an external module "externals" containing all the code.

/

 

pythoncaller-external_1.fmw

jstanger
Forum|alt.badge.img+1
  • April 24, 2019

Ah but, unless the FMW somehow packages up the required external Python file(s) then you no longer have an FMW that is independent of external dependencies and you lose a major benefit which is system portability. I would object to this feature and would rather have easier tools to import a script generated in an external IDE (hence fixing typos which I have been plagued from before). Maybe something like an import aware "replace current code with the following script" in the current editor?


david_r
Evangelist
  • April 24, 2019

It's a valid feedback for sure, altough for me it's very seldom that I have a workspace file that has no other external dependencies, I usually have e.g. database/web connections, config files, related workspaces, etc. So adding one more dependency is not an issue for me, at least.


LizAtSafe
Safer
Forum|alt.badge.img+15
  • Safer
  • February 8, 2024
Updated idea statusGathering InterestArchived
Idea merged into:
All the votes from this idea have been transferred.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings