PythonNative at a glance

PythonNative is a cross-platform Python tool kit for Android and iOS. It allows you to create native UI elements such as buttons and labels in a Pythonic way, regardless of whether you're running on iOS or Android.

Create your app

pip install pythonnative
pn init my_app
.
├── README.md
├── app
│   ├── __init__.py
│   ├── main_page.py
│   └── resources
├── pythonnative.json
├── requirements.txt
└── tests

Write your views

Everything in PythonNative is a view.

import pythonnative as pn


class MainPage(pn.Page):
    def __init__(self, native_instance):
        super().__init__(native_instance)

    def on_create(self):
        super().on_create()
        stack_view = pn.StackView(self.native_instance)
        list_data = ["item_{}".format(i) for i in range(100)]
        list_view = pn.ListView(self.native_instance, list_data)
        stack_view.add_view(list_view)
        self.set_root_view(stack_view)