[Tutor] Scheduling Python Execution

Sven svenito at gmail.com
Mon Apr 15 12:53:05 CEST 2013


I assume that you are getting these times from somewhere, hopefully a
website. To do as Steve says, you would just scrape (or use the API if
there is one) to get the times, and schedule a tweet at that time. If you
do use cron you can make use of https://pypi.python.org/pypi/python-crontab


On 15 April 2013 10:23, Zaki Akhmad <zakiakhmad at gmail.com> wrote:

> On Mon, Apr 15, 2013 at 3:51 PM, Alan Gauld <alan.gauld at btinternet.com>
> wrote:
>
> > multiple cron jobs will be less work for your computer than running a
> long
> > term program constantly checking times and launching your scripts...
> That's
> > called reinventing the wheel with a square one...
> >
> > There are more modern (and more efficent) replacements for cron but given
> > your requirements cron still looks like the best bet.
>
> Actually,
>
> I want to write a twitter bot which runs on a specific time. For an
> idea, I'd like to have this twitter bot tweet every sunrise and
> sunset, everyday. Since everyday the sunrise and the sunset time are
> vary, what are the best way to do it?
>
> Should I entered the sunset and the sunrise manually?
>
> Thanks!
> --
> Zaki Akhmad
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
./Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130415/576b4988/attachment.html>


More information about the Tutor mailing list