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.
Notifications and callback to myself
-
Hi all,
Isn't it possible to call my python script from a notification schedule with a callback url or is there a bug in the app?
This currently doesn't work:
# coding: utf-8 import notification notification.schedule('test', 5, 'default', 'pythonista://test.py?action=run')
The script should send my a notification after 5 seconds. After accepting the notification the script should start again automatically.
Daniel
-
This worked fine for me, though I printed something in test.py first so it was obvious that it was running. one quirk: if pythonista is already open, you won't get a notification popup, it will just run. Try switching to another app while you wait, and bump up the delay a tad.
If you are running a script already, you will simply lose the notification.
-
Hi Jon.
I only get one notification. Do you really get multiple notifications (with a 5-sec delay after clearing the notification)?
-
yes. here is the exact test.py i used. note this must be in the main Documents folder
# coding: utf-8 import notification print 'hi' notification.schedule('hello',5,action_url='pythonista://test.py?action=run')
-
Also... don't "clear" the notification, tap it.
If you leave pythonista open, it will just keep printing hi.
-
Strange. Doesn't work.
I used your code and did:
- start the script test.py
- leave pythonista (went to the homescreen)
- don't lock the screen
- wait for the notification
- accept the notification
- pythonista is opened
- I see the "console" screen
- the script DOESN'T started again automatically :-(
-
ios version and device?
if you just open the pythonista link in safari, does it open and run? -
iPhone 6s Plus running iOS 9.2
Pythonista 2.0The link works in safari. The script runs automatically.
-
This works fine on my iphone6 and iPad Air1.
But on iPad Pro with identical program I get an error "...no attribute shedule".On all these devices I running Beta 201001
Does someone have an hint?A second question. The reminder is not able to send a reminder to another iOS device with same Pythonista installed?
-
But on iPad Pro with identical program I get an error "...no attribute shedule".
Maybe you introduced a typo somehow? It should be
schedule
, notshedule
.A second question. The reminder is not able to send a reminder to another iOS device with same Pythonista installed?
No, the
notification
module is just for timers etc. on the same device. You can use thereminders
module to create reminders (optionally with notifications) that can be synced via iCloud. -
@omz thank you for your reply.
Okay, typo here in the text, but not in the program.:import notification
notification.schedule('Hi guys!',10) -
@wnMark Just a guess: Have you perhaps created a script of your own, named
notification.py
on the iPad Pro? That would "shadow" the built-in module. -
@omz
Lessons Learned!You're a mastermind!