我func1()
调用了func2()
,但func2()
的调用在func1()
完全完成后开始。如何在func2()
完全完成后立即执行func1()
?
我的代码:
def func1(self):
self.path='1'
self.func2()
print self.path #I want to get correct path, not '1'
def func2(self):
self.openFileBut = Button(self, text="Open image", command=self.openFileBut)
self.openFileBut.pack(side=LEFT, fill=None)
def openFileBut(self):
ftypes = [('All files', '*')]
dlg = tkFileDialog.Open(self, filetypes=ftypes)
f = dlg.show()
self.path = f
if self.path != '':
self.createCanv(self.path)