Pythonista empty start screen
My scripts, when started via url scheme (pythonista://MyApps/Scriptname?action=run), always begin by a full screen ui.view hiding the App background and hiding the title bar, and are ended by buttons which return to the Apple home screen via webbrowser.open("launcher://crash"). So, the user would never see the Pythonista app, nor at begin, nor at end.
Could it be possible that, when Pythonista starts by its url (ex: launched by any Launcher app or by an home screen icon), the App shows an empty start screen instead of its main menu?
Thanks for your help.
From the latest update:
You can customize the startup process of the Python interpreter by creating a file named “pythonista_startup.py” in the site-packages folder. When the app is launched, the interpreter will execute this module, so that all variables/functions/classes in the script become available globally. A common use case might be from math import * (if you want to use the console as a calculator). Note: If Pythonista becomes unusable due to a misbehaving startup script, you can launch the app in a “clean” state by entering pythonista:// in Safari’s address field.
You could use the editor module to load an empty file.
I'm not confident that will work when you load a script via the URL scheme though...but you can try!
pythonista_startup.pyis not run when you launch the app from a URL scheme. It's only run if you launch the app manually. All this would accomplish would be loading an empty file every time you opened the app.
I'm thinking about adding some optional arguments to the URL scheme to basically show an empty screen (or perhaps a colored background with an icon) when launching a script via URL scheme. I haven't really started implementing any of it though, and there are a couple of things with higher priority on my todo list right now.
Tanks everybody for your answers.
I think that, as OMZ said, there is no solution actually.
Not very important because there is only 1 second between the launch via Url and the load of my ui.view and during this second max, the start screen of Pythonsta is displayed.
@omz do you still plan to add this optional argument to the URL scheme?
Anyway, one more time, thanks for your marvelous app!
See the hoped result