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.
Forum Archive
Background timer
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.