Skip to main content
10000+ Posts
update a (global) variable in a PythonCaller and use it in another PythonCaller

Dear all,  I am facing the following issue - sounds very simple : I have a 2-column table that gives a mapping oldname->newname that I store in a dictionnary inside a PythonCaller ; in another PythonCaller, I need to use this dictionary.So far, I am doing the following : 1) in Python Start-up script, I define a global variableglobal mydictmydict = {}2) in the 1st PythonCaller : I populate a dictionary in the `input`function and then in the `close`function , I update the value of the global`all_progs` class FeatureProcessor(object):    def __init__(self):        tmpdict={}        pass    def input(self,feature):        # do something like :        tmpdict['oldname'] = 'newname'     def close(self):        mydict = tmpdict        pass3) in the 2nd PythonCaller I would like to use this dictionary ; but when I try iterating over t

Badge Winners

  • Welcome Back
    okainunoohas earned the badge Welcome Back
  • FME Flow Certified Professional
    kruti_811has earned the badge FME Flow Certified Professional
  • FME Certified Professional
    bkjhas earned the badge FME Certified Professional
  • Expert (Bronze)
    timatsafehas earned the badge Expert (Bronze)
  • FME Form Advanced Training
    mike_greshhas earned the badge FME Form Advanced Training
Show all badges

Community Stats

32,431
Posts
123,238
Replies
40,558
Members