hello all,
I'm very new to python, so please if my question look silly be kind :)
I have a question that I guess is half python coding and half pythonanywhere.
I tried to upload a simple server, that send push notification to my phone every minute (just for testing),
to do so I uses a timer:
def start_timer(token):
interval = 60*1
def timer_tick():
print('>>>>>>>>>> timer tick')
msg = 'some message'
apns.send_push(token, msg)
timer = threading.Timer(interval, timer_tick)
timer.start()
return 1
return timer_tick()
at first It look like the timer wasn't firing, and I thought it has something to do with the fact that it uses threads, and maybe the pythonanywhere env don't allow that.
but somehow its start working, and now I get push to my phone every minute, the problem is, I don't know how to stop it!
I tried to change the code and reload the server, I even deleted the app, but I still get the push.
so I have 2 questions:
1. first does this code suppose to work? I mean can I use timer in pythonanywhere env?
2. is it possible that using the timer cause it to run on a separate process that I can't stop?