Triggering a function within a function python -


i want able call third function play within other 2 functions in example below whenever press buttons. how can while keeping value s?

import wx  class mydialog(wx.dialog):     def __init__(self, parent, id, title):         wx.dialog.__init__(self, parent, id, title, wx.defaultposition, wx.size(350, 100))           wx.button(self, 1, '1', (100, 10))         wx.button(self, 2, '2', (185, 10))          self.bind(wx.evt_button, self.one, id=1)         self.bind(wx.evt_button, self.two, id=2)       def one(self,event):         s=1        def two(self,event):         s=2      def three(self,event):         print s  class myapp(wx.app):     def oninit(self):         dlg = mydialog(none, -1, 'example')          dlg.show(true)         dlg.centre()          return true  app = myapp(0)  app.mainloop() 

just call thee self.three(value):

def one(self, event):     self.three(1)  def two(self, event):     self.three(2)  def three(self, s):     print s 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -