submit=wx.Button(panel, label="Submit", pos=(245,207), size=(50,30))
self.Bind(wx.EVT_BUTTON, self.get_answer, submit)
self.user_input = wx.TextCtrl(panel, -1, "", pos=(140,207))
def get_answer(self, event):
self.interpreter.AppendText("\nShall we start? yes/no: ")
rep1=self.user_input.GetValue()
if rep1=="yes":
self.interpreter.AppendText("OK, Your guess? ")
for i in range(5):
guess=self.user_input.GetValue()
if guess in a_word:
self.interpreter.AppendText("Yes!")
else:
self.interpreter.AppendText("No!")
if rep1=="no":
self.interpreter.AppendText("OK, may be next time. Buy!")
Shall we start? yes/no: YES(user input)
The word contains 5 letters.
Your guess? No!No!No!No!No!
заранее спасибо,
извините, вопрос, наверное глупый, но я учу wx всего 2ую неделю!