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.
Background timer
-
Is there a way to create an alarm/timer which will run in the background? I see that the alarm method is not in the signal module but I wondered if there was a way to do this.
-
You can schedule a notification.
import notification notification.schedule('2 minutes have passed',120)
-
Thanks, that helps. Just curious, do you know if the absence of the alarm method is due to the sandboxing (although other apps can implement alarms) or some other reason?
-
A notification IS an alarm. You can set the time, and a sound to play, and and action to take when the user hits ok. That action can be another pythonista script using the pythonista url format.
-
Thanks, I understand that I can change existing scripts that use signal.alarm. I was just wondering whether the deletion of the signal.alarm method is a result of some undesired effect (from Apple's POV) or some other reason.
-
Ahhh... You are talking about the Python Standard Library module https://docs.python.org/2/library/signal.html
-
Exactly. As also found in the Pythonista docs: http://omz-software.com/pythonista/docs/library/signal.html
-
I believe that only OMZ can tell us why there is no signal.alarm() function. But notification.schedule is a reasonable iOS-specific substitute.