开发者

Scheduling Tasks

I run MAC OS X. So I have completed a python script that essentially parses a few sites online, and uploads a particula开发者_StackOverflow中文版r file to an online server. Essentially, I wish to run this script automatically from my computer about 20 times a day. Is there a solution to schedule this script to run at fixed time points everyday? Does this require compiling the python code into a .exe file?

Thanks a lot!


The OS provides a tool called 'cron' that's for exactly this purpose. You shouldn't need to modify your script at all to make use of it.

At a terminal command prompt, type man cron for more info.


You can check also launchd, it's the OS X replacement of cron (you can still use cron but it's kind of deprecated on OS X).

Docs: Getting Started with launchd

I can also recommand you Lingo app to help you working with launchd.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜