def select(widget, data): global buttons, current_note, right, total string, fret = data try: buttons[string, fret].grab_focus() except KeyError: pass guess = note(string, fret) play_note(guess) total += 1 if guess==current_note: right += 1 status.set_markup('<span foreground="dark green" size="x-large">RIGHT</span> %d%%' % int(100.0*right/total)) gobject.timeout_add(1500, new_question) else: status.set_markup('<span foreground="red" size="x-large">FALSE</span> %d%%' % int(100.0*right/total)) gobject.timeout_add(400, play)
def play(*args): global current_note play_note(current_note)