pip install pythonnative
pn init my_app
.
├── README.md
├── app
│ ├── __init__.py
│ ├── main_page.py
│ └── resources
├── pythonnative.json
├── requirements.txt
└── tests
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)