[code 1](rhello.py) 01: #! /usr/bin/env python 02: 03: import Tkinter as Tk 04: import random as R 05: 06: 07: class Label(Tk.Label): 08: def __init__(self, master=None): 09: Tk.Label.__init__(self, master, text='Hello world!', font=('Helvetica', '24', 'bold')) 10: self.bind_all('<1>', self.bg_change) 11: 12: def bg_change(self, event): 13: r = R.randint(0,255) 14: g = R.randint(0,255) 15: b = R.r
![Tkinter 入門: 3. Label だけでタイマーを作ろう](https://cdn-ak-scissors.b.st-hatena.com/image/square/d0f911d15e3bf4e692e901ae3d68008939ece687/height=288;version=1;width=512/http%3A%2F%2Fwww.shido.info%2Fpy%2Falarm.jpg)