referenced by local tmp is reclaimed on function exitthe tk variable is unsetand the setting is lost (all buttons come up unselectedthese radio buttons work finethoughonce you start pressing thembecause that resets the internal tk variable uncommenting the global statement here makes start out setas expected this phenomenon seems to have grown even worse in python xnot only is " not selected initiallybut moving the mouse cursor over the unselected buttons seems to select many at random until one is pressed (in we also need to initialize string var shared by radio buttons as we did in this section' earlier examplesor else its empty string default selects all of them!of coursethis is an atypical example--as codedthere is no way to know which button is pressedbecause the variable isn' saved (and command isn' setit makes little sense to use group of radio buttons at all if you cannot query its value later in factthis is so obscure that 'll just refer you to demo-radio-clear py in the book' examples distribution for an example that works hard to trigger this oddity in other ways you probably won' carebut you can' say that didn' warn you if you ever do scales (slidersscales (sometimes called "sliders"are used to select among range of numeric values moving the scale' position with mouse drags or clicks moves the widget' value among range of integers and triggers python callbacks if registered like check buttons and radio buttonsscales have both command option for registering an event-driven callback handler to be run right away when the scale is movedand variable option for associating tkinter variable that allows the scale' position to be fetched and set at arbitrary times you can process scale settings when they are madeor let the user pick setting for later use in additionscales have third processing option--get and set methods that scripts may call to access scale values directly without associating variables because scale command movement callbacks also get the current scale setting value as an argumentit' often enough just to provide callback for this widgetwithout resorting to either linked variables or get/set method calls to illustrate the basicsexample - makes two scales--one horizontal and one vertical--and links them with an associated variable to keep them in sync example - pp \gui\tour\demoscale py "create two linked scales used to launch dialog demosfrom tkinter import from dialogtable import demos from quitter import quitter get base widget set button callback handlers attach quit frame to me checkbuttonradiobuttonand scale