Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GUI Programming with Python—The Road Ahead
Search
Tzu-ping Chung
June 05, 2015
Programming
0
260
GUI Programming with Python—The Road Ahead
Talk given at PyCon APAC 2015 in Taipei, Taiwan.
Tzu-ping Chung
June 05, 2015
Tweet
Share
More Decks by Tzu-ping Chung
See All by Tzu-ping Chung
Datasets: What it is, and how it was made
uranusjr
0
130
Let’s fix extras in Core Metadata 3.0
uranusjr
0
510
Python Packaging: Why Don’t You Just…?
uranusjr
1
220
這樣的開發環境沒問題嗎?
uranusjr
9
2.6k
Django After Web 2.0
uranusjr
3
2.1k
We Store Cheese in A Warehouse
uranusjr
1
450
The Python You Don’t Know
uranusjr
17
3.1k
Python and Asynchrony
uranusjr
0
360
Graphics on Raspberry Pi with Qt 5
uranusjr
0
96k
Other Decks in Programming
See All in Programming
color-scheme: light dark; を完全に理解する
uhyo
7
500
Swift Testingのモチベを上げたい
stoticdev
2
120
LINE messaging APIを使ってGoogleカレンダーと連携した予約ツールを作ってみた
takumakoike
0
120
Jakarta EE meets AI
ivargrimstad
0
490
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
1.1k
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
140
楽しく向き合う例外対応
okutsu
0
700
Unity Android XR入門
sakutama_11
0
180
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
210
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
41
16k
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
14
4.7k
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
310
Featured
See All Featured
Designing Experiences People Love
moore
140
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
650
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Navigating Team Friction
lara
183
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Building an army of robots
kneath
303
45k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Git: the NoSQL Database
bkeepers
PRO
427
65k
Transcript
The Future of GUI Programming with Python
Me • Call me TP • Follow @uranusjr • https://uranusjr.com
None
None
http://macdown.uranusjr.com
www. .com
Terminology • User interacts with a program through a user
interface (UI) • A UI based on images is a graphical user interface (GUI)
I want a GUI library that works. works
None
What I Want • Native UI and UX • Portability
• Ease to deploy • Pythonic API
What We Have
Tkinter • “Python’s de-facto standard GUI” • Native nowhere •
Themed Tk • Binding to Tcl/Tk • Lean, but may be lacking
Platform-specific • PyObjC on OS X (Cocoa) • Win32API on
Windows • PyGObject on Gnome (GTK+) • Native UI/UX • Needs to deploy C binding • Very weird API
Special Interpreters • .NET via IronPython (Windows) • AWT/Swing via
Jython • Weird API • Compatibility with other libraries
Binding to Third-party • PyQt and PySide to Qt •
wxPython to wxWidgets • Works quite natively • Cross-platform application code • Weird API • Needs to deploy tons of things
“Let’s Build Everything” • Kivy and Pyglet • Cross-platform application
code • Nice Pythonic API • Needs to deploy C binding • Not native (and they don’t care)
Solution UI/UX Portable API Deploy Tkinter Meh Platform-specific Meh Jython
Meh Meh Third-party Bindings Kivy / Pyglet Meh
Licensing • GPL and LGPL • Source distribution • Static
linking
So?
What I Want • Native UI and UX • Portability
• Ease to deploy • Pythonic API
The Solution (IMO) • Dynamic binding to native GUI •
CPython compatibility • No non-Python dependencies • Wrapper API on top
Native API Python API Wrapper Binding (in Python)
The Binding • Foreign function interface • libffi • ctypes
• CFFI, anyone?
Native API Python API Wrapper ctypes
Native API Python API Wrapper GTK+ ctypes PyGObject
Native API Python API Wrapper ctypes
Native API C API (e.g. CoreFoundation) Python API Wrapper ctypes
Objective-C API ctypes + wrapper
IUUQQZCFFPSHUPHB
How?
toga toga-win32 toga-cocoa toga-gtk … rubicon PyGObject ctypes Native GUI
Library
toga toga-win32 toga-cocoa toga-gtk … rubicon PyGObject ctypes Native GUI
Library
None
None
None
……
None
Difficulties • API design • Platform knowledge • UI Layout
https://github.com/pybee/toga
WHAT IF I AM INTERESTED IN SOMETHING ELSE?
Did I hear mobile?
lwn.net/Articles/640625/ You might also want to read this.
Mobile Support • API availability • The Store • “Paradigm
mismatch”
None
Python Issue #23670 Modifications to support iOS as a cross-compilation
target
None
?
None
None
None
Recap • What we have is not good enough •
Proposed solution • Python on mobile OSs
WHAT IF I AM INTERESTED IN SOMETHING ELSE?