我有以下代码:
try:
redirect_url = self.auth.get_authorization_url()
webbrowser.open_new(redirect_url)
except tweepy.TweepError:
print 'Error! Failed to get request token.'
verifier=raw_input("Enter verification code: ")
try:
self.auth.get_access_token(verifier)
print "Access granted"
self.__key,self.__secret = self.auth.access_token.key,self.auth.access_token.secret
self.set_tokens(self.__key,self.__secret)
print self.__key, self.__secret
except tweepy.TweepError:
print "Error! Failed to get access token!"
如何在实现 wx.Frame 时停止执行第二个 try-except 块。例如,以便在按下按钮之前它不会继续?