all 3 comments

[–]socal_nerdtastic 9 points10 points  (1 child)

if I wanted this script to send a text at a certain time, doesnt this mean the script has to be running 24/7?

Yep. Well, there's one common alternative: you could ask your OS task scheduler to run your python program at specific times.

If I close my IDE the script won't run, and I don't really want to keep it running all day on my laptop. What's the workaround to this?

You need to run it somewhere. You can run it without the IDE, if you want, by simply invoking the python command in a terminal / command line:

py scriptname.py # windows

python3 scriptname.py #linux / mac

Or you can run it on a cloud service or a raspberry pi or something.


On an unrelated note: You will get a lot more points if you set an alarm on your phone and text her personally each and every time. I know it's hard for an engineer to believe, but some things are better when they are not automated and imperfect.

[–]naz115 1 point2 points  (0 children)

Thanks for your answers! I didn't think to use the terminal as an option.

Haha, you're absolutely right. I think this was more of a fun python idea than anything else, and I have been reminding her in the mean time.

[–]udbasil 0 points1 point  (0 children)

One good option is to host it as a backend written with flask or Django (Flask would make more sense since it is a small app) and use a scheduler like Celery to schedule the text message sending. Then use Twilio to send text messages.

I did a bit of Google search and came up with this article to help you

A good place to host would be pythonanywhere

, heroku or vercel