PyBox / GUI apps and OpenGL

Run Tkinter, Kivy and pygame apps on Android.

PyBox runs a real X11 desktop with a window manager and a GPU renderer. GUI Python opens in windows on your phone or tablet, with touch, keyboard and clipboard mapped to it.

How it works

Python GUI toolkits draw through X11. Android has no X11, so PyBox ships one. An X server runs inside the app with a window manager embedded in it, and a GPU renderer handles OpenGL. When you press Run on a GUI script, its window appears on the PyBox desktop: a panel on top, a taskbar below, windows in between.

  • Real windowsMove, minimize, maximize and close. The windows list shows what is open.
  • OpenGL up to 4.3GPU mode runs old and modern OpenGL. GPU safe is OpenGL 3.3. GPU exact is GL 2.1 and GLES 3.2. CPU is slow and exact.
  • Touch mappingDirect touch or touchpad mode, pointer speed, two-finger tap to right-click, natural scrolling, multitouch pinch.
  • Keyboard mapping and clipboardHardware keyboards work. Clipboard text moves between Android and X11.
  • Display controlResolution, DPI, frame rate limit, cursor size, fit to window on rotation and split screen.
A Tkinter tic-tac-toe game running on the PyBox X11 desktop

What runs

Kivy logo

Kivy

Touch-first UI apps. Kivy is in the PyBox wheel index, so pip finds a binary build.

Tkinter and Turtle

The standard-library GUI, with 2048, Minesweeper, Paint and Pendulum Lab among the starter projects. Turtle demos and IDLE are in the drawer.

pygame and PyOpenGL

pygame games and PyOpenGL scenes. A starter project, OpenGL Spinning Cube, draws a 3D cube with pygame and OpenGL.

Matplotlib logo

Matplotlib windows

Interactive figures with zoom and pan open as windows, not only inline images.

SDL apps

SDL programs are bridged to the desktop, so SDL-based games and tools can run too.

IDLE

Python IDLE runs from the drawer, as on a computer.

Tune it for your device

If an app draws something wrong, change the OpenGL renderer in Settings. Resolution, DPI and cursor size apply the next time a GUI app starts.

GUI display settings in PyBox
The windows list on the PyBox desktop

Questions

Can Android run Tkinter?

Yes, with PyBox. It runs an X11 server and a window manager inside the app, so a Tkinter window opens on the PyBox desktop.

Does PyBox support OpenGL?

Yes. The GPU renderer supports OpenGL up to 4.3. GPU safe (3.3), GPU exact (2.1 and GLES 3.2) and CPU modes help apps that misdraw.

Can I run Kivy on Android with PyBox?

Yes. Kivy is available as a prebuilt wheel, and its windows open on the X11 desktop.

Does multitouch work in GUI apps?

Yes. Turn on Multitouch in Settings and PyBox sends every finger to apps as real touch, so pinch and multi-finger gestures work. With it off, touch acts as a mouse.

Try PyBox on your device.