[英]How to write windows service to schedule run python script in particular time
You don't need a service to schedule a Python script. 您不需要服务即可安排Python脚本。 Just use Windows Task Scheduler to run it. 只需使用Windows Task Scheduler即可运行它。 When I do this I usually wrap the invocation of Python in a batch file, so the scheduler runs mytask.cmd
but you can also schedule a complete command line invocation of the interpreter, for example: c:\\python36\\python.exe mytask.py
. 当我这样做时,我通常将对Python的调用包装在一个批处理文件中,以便调度程序运行mytask.cmd
但您也可以调度对解释程序的完整命令行调用,例如: c:\\python36\\python.exe mytask.py
。
Task Scheduler is in the Control Panel. 任务计划程序在控制面板中。 Open Control Panel, and in the top right hand corner ("Search Control Panel") type Schedule . 打开控制面板,然后在右上角(“搜索控制面板”)中输入Schedule 。 One of the options you will get is Administrative Tools | 您将获得的选项之一是“管理工具”。 Schedule tasks. 安排任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.