Hi,

I have some lines of code which currently look like this:

      self.window = self.wTree.get_widget("mainWindow")
      self.outputToggleMenu = self.wTree.get_widget("menuitem_output_on")
self.outputToggleButton = self.wTree.get_widget("button_toggle_output")
      self.logView = self.wTree.get_widget("textview_log")
      self.logScrollWindow = self.wTree.get_widget("scrolledwindow_log")

and I would like (for tidiness / compactness's sake) to replace them with something like this:
        widgetDic = {
           "mainWindow": self.window,
           "menuitem_output_on": self.outputToggleMenu,
           "button_toggle_output": self.outputToggleButton,
           "textview_log": self.logView,
           "scrolledwindow_log": self.logScrollWindow
        }
        for key in widgetDic:
... set the variable in dic[key] to point to self.wTree.get_widget(key) somehow

what I need is some kind of indirect assignment where I can assign to a variable whose name is referenced in a dictionary value.

Is there a way of doing this in python?

thanks,

andy baxter

--

http://highfellow.org

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to