Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOpsPorto Meetup19: GUI programming on Python...

DevOpsPorto Meetup19: GUI programming on Python with Tkinter by Vitor Domingos

One of the most overlooked packages from The Python Standard Library is tkinter and it's child ttk. Tkinter allows us to build graphic user interfaces without adding external dependencies, and with a bit of care, it allows for a good user experience. While learning Python programming, I have been exploring tkinter/ttk as a tool for building user-friendly graphical interfaces. I would like to share that experience and some of the insights that have arisen during that process. Tkinter may not be able to replace a native GUI toolkit, but can certainly be an important addition to any developers toolbox, both for personal use or for bridging our code to less technical users.

DevOpsPorto

August 01, 2018
Tweet

More Decks by DevOpsPorto

Other Decks in Technology

Transcript

  1. What is tkinter? "Tkinter is Python's de­facto standard GUI (Graphical

    User Interface) package. It is a thin object­oriented layer on top of Tcl/Tk."
  2. • Text • Scale • Scrollbar • Spinbox • Progressbar

    • Treeview • Separator Available widgets (incl. ttk) • Label • Entry • Button • Checkbutton • Menubutton • Radiobutton • Combobox • Toplevel (+windows) • Frame • LabelFrame • PanedWindow • Notebook • Sizegrip • Canvas
  3. ...and some more in these modules • tkinter.scrolledtext • tkinter.colorchooser

    • tkinter.filedialog • tkinter.messagebox • turtle
  4. PROS • It’s simple to learn. • Bundled with Python.

    • Highly portable. • Can look [kind of] native. • It’s fast enough. • Mature and stable. • Free for commercial use. So, should I use tkinter?
  5. PROS • It’s simple to learn. • Bundled with Python.

    • Highly portable. • Can look [kind of] native. • It’s fast enough. • Mature and stable. • Free for commercial use. CONS • Limited widget set (e.g. no date picker, no webview). • No UI designer. • Doesn’t look totally native. • It’s not as fast as a native Swift or C++ GUI. • Usually, no new features. So, should I use tkinter?
  6. Tkinter GUI Aplication Development Blueprints Bhaskar Chaudhary Packt Publishing, 2015

    Useful books: Python GUI Programming Cookbook Burkhard A. Meier Packt Publishing, 2017
  7. • https://stackoverflow.com/questions/tagged/tkinter Sooner or later, you will probably find, on

    StackOverflow, some insightful answers from a guy named Brian Oakley. You definitely should trust him. In case you get stuck...