book for examplesome exchange code simplicity for richer widget sets wxpythonfor exampleis much more feature-richbut it' also much more complicated to use by and largethoughother toolkits are variations on theme--once you've learned one gui toolkitothers are easy to pick up because of thatwe'll focus on learning one toolkit in its entirety in this book instead of sampling many partially although they are free to employ network access at willprograms written with traditional guis like tkinter generally run on singleself-contained machine some consider web pages to be kind of gui as wellbut you'll have to read the next and final section of this to judge that for yourself for good time there' much more to the tkinter toolkit than we've touched on in this previewof courseand we'll study it in depth in this book as another quick example to hint at what' possiblethoughthe following scriptfungui pyuses the python random module to pick from listmakes new independent windows with topleveland uses the tkinter after callback to loop by scheduling methods to run again after number of millisecondsfrom tkinter import import random fontsize colors ['red''green''blue''yellow''orange''cyan''purple'def onspam()popup toplevel(color random choice(colorslabel(popuptext='popup'bg='black'fg=colorpack(fill=bothmainlabel config(fg=colordef onflip()mainlabel config(fg=random choice(colors)main after( onflipdef ongrow()global fontsize fontsize + mainlabel config(font=('arial'fontsize'italic')main after( ongrowmain tk(mainlabel label(maintext='fun gui!'relief=raisedmainlabel config(font=('arial'fontsize'italic')fg='cyan',bg='navy'mainlabel pack(side=topexpand=yesfill=bothbutton(maintext='spam'command=onspampack(fill=xbutton(maintext='flip'command=onflippack(fill=xbutton(maintext='grow'command=ongrowpack(fill=xmain mainloop(run this on your own to see how it works it creates main window with custom label and three buttons--one button pops up new window with randomly colored labeland the other two kick off potentially independent timer loopsone of which step adding gui