I am looking for an app for my Moto e6 android phone that will accept a
number of hours and count down. Then will beep every minute until I cancel
the app. This is to remind me when to take my insulin.
It has been written in python but I do not know how to convert it to an app.
I wonder how much of the python code will still apply. When I was into this
in the past, I installed Kivy and was able to finally generate a "Hello
World" app and managed to get it to my phone. Then life called me back to
reality and I lost track of what I was doing for a few years. )-: I doubt I
can go through that installation and learning curve again.
It works on my computer but I have projects that interfere with the alarm.
This is why I would prefer to have it on my phone.
I appreciate any assistance you can provide.
Steve
----------------------------------------------------------------------------
----------------
Footnote:
There's 99 bugs in the code, in the code.
99 bugs in the code.
So I take one down and patch it all around.
Now there's 117 bugs in the code.
-
## Copyright Ambrosini 2017
#import re
#import random
import time
#import datetime
#from datetime import datetime
import winsound #as ws
#global delayTime
#global DelayTime
print()
print(" Enter 0 to test the alarm section.")
delayTime = input(" How many hours to next insulin check? (3) ")
if delayTime == "":
delayTime = 3
DelayTime = int(delayTime)
winsound.MessageBeep(-1)
print()
# =================================================
def Alarm(D):
AX = 0
while D >= 1:
d = str(D)
AX += 1
ax = str(AX)
print(' ' + ax, end='...' + "\n") # minutes late
time.sleep(60)
D -= 1
import winsound #as wsBeep
winsound.MessageBeep(1)
def countdown(DelayTime):
import time
t = str(DelayTime)
if t == "1":
print(" An alarm will start sounding in " + t + " hour...")
else:
print(" An alarm will start sounding in " + t + " hours...")
while DelayTime >= 1:
t = str(DelayTime)
time.sleep(3600)
DelayTime -= 1
import winsound as wsBeep
wsBeep.MessageBeep(1)
print(' More Insuin? \n')
Alarm(30000)
countdown(DelayTime)
--
https://mail.python.org/mailman/listinfo/python-list