Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Python console in the Today widget
-
The notification center widget is only available in the Pythonista 3 beta, and widget scripts are always run using Python 3. You can run the script normally from the editor, but that just pops the keyboard up as a normal view, which isn't very useful. (It also breaks
sys.stdin
if you run it normally instead of setting it as a widget script.) -
@dgelessus , all you say is right. But what I can't see is the editor window. I can see something...but it's like alpha .03 or something like that. I have a very dark custom theme set in Pythonista. I did change it to the very white default theme. I forced quit Pythonista and removed and re added Pythonista today widget. Same result. The only thing I didn't do, was to do was reboot my ipad
-
is the widget only an ios9 thing? 64 bit thing? I cannot seem to even see an option for enabling the widget(i both betas installed)
-
@JonB I accidentally set a deployment target of 9.3 for the widget (Xcode's default), so in the current beta, it won't show up on iOS 8 (or even older versions of iOS 9), will be fixed in the next build.
-
@dgelessus Thanks for clarifying. i just got Pythonista 3 and tried it out.
Unfortunately for me, it seems to show up for a brief second and disappear. After a few times of auto-reloading it says unable to load.
Seems to sound like the limits on memory @omz mentioned in the release notes. i have a decent number of libraries in my site-packages that might be causing the issue, I assume the entire site-packages is loaded in the today widget.
-
@khilnani No, the
site-packages
modules are only loaded when youimport
them.If you have a
pythonista_startup
file, you may want to add anappex.is_widget()
check and make it not run in the today widget. Also you should try going to the home screen and then open the notification center - then you don't have any other app in the background taking up RAM. -
The widget should actually skip
pythonista_startup
. -
It turned out my problem with not seeing the text clearly was to do with the accessibility setting: Reduce Transparency, does not work so well in the today view
-
@dgelessus i'm not using pythonista_startup. i restarted the phone and tried it before launching any apps- entered my passcode for the home screen and pulled down. I see the same - the keyboard slides down and then disappears leaving a unable to load message.
i'm using 9.3.1 on an iPhone 6 Plus. let me know if there is anything i can help with if you'd more info. the script works within from within Pythonista.
-
Do you have many other widgets added? That's the only other possible issue I could think of. I'm on an iPad mini 1, which is a few years old, so I wouldn't expect you to have many issues on an iPhone 6...
-
Good point. I had Battery, Launcher, Dataman, and Darksky Next hour. Removed them all and only kept Pythonista, seems better still disappears after a second or two (vs half a second before)
-
pythonista_startup does seem to run in the today widget. Is there a way to check if the interpreter is being run in the today widget? I'd like to modify my startup to bypass if inside the today widget
-
@JonB The widget never runs the startup script.
-
I am using @dgelessus's pythonista_startup, which is a folder called pythonsta_startup in site-packages with an init. My widget is just doing
import appex,ui v=ui.View(bg_color='red',frame=(0,0,200,200)) appex.set_widget_view(v)
but pythonista startup seems to be running ( until i get s could not load)
-
@JonB Okay, that's a bug then. For now, you might want to check
appex.is_widget()
in your startup script. -
@JonB I found the bug, the "preflight" script (for clearing globals etc.) was importing
pythonista_startup
as a side effect. -
I tried the new examples for "Today widget" on my iPad Pro 12,9" with iOS 9.3.2 and all worked fine. But on my iPhone6 and iPhone5s I got the message "Kann nicht geladen werden". I did some reboots! On both iPhones I am running iOS 9.2.1. The widget worked before on iPhone. I am sorry I do not know the beta#
Some hints?
-
@wnMark Please try again with the next beta (later today or tomorrow, I think). There's been an issue with the widget consuming too much memory in the current beta, and I think it'll be fixed in the next build.
-
@omz thank you for your reply. I will try
-
For me it looks the same on Beta 300017. Worked fine on iPad Pro. But all examples do not work on iPhone6.