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.
Today Widget: Get print() working
-
I tried to create a simple today widget for the latest Pythonista Beta that just prints the time. The widget logo shows on the screen, but nothing else happens.
'''testing today widget
'''
import datetime as dt
print('Python time is %s'%dt.datetime.now())What's needed to get this working?
Georg -
Just using
print('blah')
worked for me. Your simple example also worked. Are you sure you set the right script in Pythonista's settings? -
That should work. I found that in some cases (pretty rare), the widget script doesn't run automatically when you pull down Notification Center, and you may have to tap the run button in the widget manually (the triangle is not a logo). I'm not sure why this happens.
-
Seems to be working now. I did not see the run button during my previous attempts. Maybe I was too impatient with my slow iPad 2...
Resolved! Thanks,
Georg -
After the .10 update this evening, it stopped working again. The widget was at the lower end of my displayed widgets, and did not show the run-triangle nor the script result. It started working after moving the widget to the top of the list.
I wonder if the widget position contributes to the problem, or if the python interpreter running the widget just needs a lot of time for the first start up.
Georg -
@georg-viehoever How many widgets do you have? I wonder if the iPad 2 maybe just doesn't have enough memory to handle multiple widgets properly, and the Pythonista widget is probably more on the heavy side of things...
-
Six active widgets...
Now that the Pythonista widget has worked once, it seems to work fine every time. Strange.
Georg -
This works fine on my iPad Pro but on iPhone6 I don't see the Pythonista Entry. Any hints?
-
@wnMark I don't know why that happens. I've seen the widget disappear completely a couple of times. You could try re-selecting the widget script in Pythonista's settings. Rebooting also seems to help.
-
For me widgets sometimes disappear completely too. They don't appear in the list of available widgets at all and aren't visible in the notification center. If I'm lucky they reappear again at some point. For some reason last time rotating my screen made them reappear...
-
@dgelessus That's the intended behavior. On iPad, you can select if you want to add new widgets to the "Today View" or to the "Widgets View". When you are in Portrait orientation, all widgets appear in the same list, but when you rotate to landscape, only "Today View" widgets are listed in the left column, while all "Widget View" widgets are available via the segmented control on top of the notifications list.
-
@lukaskollmer In my case widgets don't appear under Today, Widgets or in the list of available widgets. Or to put it differently - when you tap the "edit" button at the bottom of the Today list, every widget should be somewhere in that list (under one of the three sections). Sometimes some widgets are just missing and under none of the sections.
-
No luck for me on iphone6 or iphone5s.