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
72
Let’s fix extras in Core Metadata 3.0
uranusjr
0
360
Python Packaging: Why Don’t You Just…?
uranusjr
1
200
這樣的開發環境沒問題嗎?
uranusjr
9
2.4k
Django After Web 2.0
uranusjr
3
1.9k
We Store Cheese in A Warehouse
uranusjr
1
400
The Python You Don’t Know
uranusjr
17
2.9k
Python and Asynchrony
uranusjr
0
330
Graphics on Raspberry Pi with Qt 5
uranusjr
0
96k
Other Decks in Programming
See All in Programming
ONE WEDGE_company_guide
1wedge_one
0
440
Front-end application development, Symfony-style(s)
dunglas
2
2k
見た目から始める生産性向上
ikumatadokoro
7
780
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
コードレビューで学ぶ!Kotlinオブジェクト指向デザインパターン
akkie76
2
190
Goのエラースタックトレースの歴史と今後
sonatard
6
670
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
350
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
640
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
220
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
320
Site Reliability Engineering for GMO
pyama86
7
1k
使ってみよう Azure AI Document Intelligence
kosmosebi
2
270
Featured
See All Featured
Happy Clients
brianwarren
91
6.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
186
16k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Building Applications with DynamoDB
mza
88
5.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
GitHub's CSS Performance
jonrohan
1024
450k
Unsuck your backbone
ammeep
663
57k
4 Signs Your Business is Dying
shpigford
175
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
226
16k
Music & Morning Musume
bryan
41
5.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?