wir, etwas bestimmtes passiert, zum Beispiel ein bestimmter Sound. Hier der Code:
Code: Alles auswählen
# -*- coding: cp1252 -*-
import pygame
import Tkinter as tk
from Tkinter import *
from functools import partial
import random
pygame.init()
label=tk.Label()
label.pack()
def knopf(label):
WORDS=("A", "B", "C", "D", "E")
label['text']=random.choice(WORDS)
button=tk.Button(text='Knopf', command=partial(knopf, label))
button.pack()
mainloop()