Tkinter GUI Programming by Example
上QQ阅读APP看书,第一时间看更新

Using variables

Instead of using configure to repeatedly change the text within our label, wouldn't it be better if we could assign a variable to it and just change this variable? The good news is you can! The bad news? Regular Python variables aren't perfectly compatible with Tkinter widgets. Shall we take a look?