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
250
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
120
Let’s fix extras in Core Metadata 3.0
uranusjr
0
490
Python Packaging: Why Don’t You Just…?
uranusjr
1
210
這樣的開發環境沒問題嗎?
uranusjr
9
2.5k
Django After Web 2.0
uranusjr
3
2k
We Store Cheese in A Warehouse
uranusjr
1
440
The Python You Don’t Know
uranusjr
17
3k
Python and Asynchrony
uranusjr
0
360
Graphics on Raspberry Pi with Qt 5
uranusjr
0
96k
Other Decks in Programming
See All in Programming
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
1.1k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1k
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
260
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
360
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
200
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
550
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
380
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
270
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
850
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Speed Design
sergeychernyshev
25
720
It's Worth the Effort
3n
183
28k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Rails Girls Zürich Keynote
gr2m
94
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
940
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Into the Great Unknown - MozCon
thekraken
34
1.6k
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?