When I play Python at home, I use an app called Pythonista3 on my iPad (past article). Pythonista3 has a library for implementing the UI of the smartphone app, and I wondered if I could do something cool with this, so I tried various things!
First, let's see what the Pythonista 3 ui library looks like!
First, create a file for UI implementation. Select "Script with UI" when creating a new file!
Doing this will create an arbitrary name, foo.py, and a foo.pyui with the same name. py is a script that everyone is familiar with. And when you open pyui
I think you will see a screen like that. This white is the screen that I will make from now on. Use the Size on the right side to make your screen size your favorite!
You can add elements to the screen with the + button on the upper left.
There are various things. I will not explain what each part is here, but I tried to make such a screen using some.
Please refer to the separate article at the end of the article for the explanation of each part! The best way to make a layout is to try it!
To run the UI you created, open the py file and run it. The following code is written in the py file from the beginning.
import ui
v = ui.load_view()
v.present('sheet')
First, let's run it as it is.
The app ran on the subscreen! This sub-screen format seems to be iPad only, and when run on iPhone's Pythonista, the app runs in full screen.Anyway, I was able to make it look and run it! Please refer to the following articles for the continuation as we will continue to make the content more advanced!
Play with the UI implementation of Pythonista [Screen elements] Playing with Pythonista UI implementation [Action implementation] Play with UI implementation of Pythonista3 [Screen transition]
Recommended Posts