UI for Pythonista and CPython
upwart last edited by upwart
I am primarily a developper of CPython applications, but find developping and prototyping under Pythonista very convenient when I am not at my Windows desktop.
I would like to use a UI package that is both available under CPython and Pythonista. Apparently neither tkinter nor PyQt are supported on Pythonista.
And the native UI from Pythonista is not available for CPython.
Is there any package or trick to use the same UI on both platforms?
ccc last edited by
No. There are TONS of threads on that topic in this forum but the answer is still no.
dgelessus last edited by
Short answer: You could probably do it, but it wouldn't be easy.
It's very difficult in general to write a single UI library that works on both desktop and mobile, because (aside from Windows UWP) desktop and mobile UIs are usually very different. Even if you stay inside the Apple ecosystem, AppKit (macOS) and UIKit (iOS) are very different in terms of UI design, user input, lifecycle, etc., and it's impossible to write a single app that works on both platforms.
Kivy is more oriented towards game development I think, so it draws its own UI elements instead of using native ones. It can't be used directly on Pythonista, because it requires compiled code, but someone has written a library called UniPaGE that provides a common API that uses Kivy on desktop and the
uimodule on Pythonista.
Toga basically the opposite, one of its main features is that it uses native UI elements on all platforms. The iOS implementation is also pure Python (it uses
ctypesinstead of actual C code) so it could in theory run on Pythonista. This would require some extra code though, because Toga assumes that it's running as a standalone app, so it doesn't work well (or at all) inside Pythonista by default.