Python GUI Programming Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How to do it...

Here's how we refactor our code:

GUI_adding_widgets_in_loop.py

Running this code will create the same window as before, but our code is much cleaner and easier to maintain. This will help us when we expand our GUI in the coming recipes.