| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
PythonNative is a cross-platform toolkit that allows you to create native Android and iOS apps using Python. Inspired by frameworks like React Native and NativeScript, PythonNative provides a Pythonic interface for building native UI elements, handling lifecycle events, and accessing platform-specific APIs.
First, install PythonNative via pip:
pip install pythonnativeInitialize a new PythonNative app:
pn init my_appYour app directory will look like this:
my_app/
├── README.md
├── app
│ ├── __init__.py
│ ├── main_page.py
│ └── resources
├── pythonnative.json
├── requirements.txt
└── tests
In PythonNative, everything is a view. Here's a simple example of how to create a main page with a list 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)pn run android
pn run iosFor detailed guides and API references, visit the PythonNative documentation.
| Back | FazBrowse Home | New Git URL |