任务调度程序认为 python 脚本仍在运行

编程入门 行业动态 更新时间:2024-10-28 13:29:17
本文介绍了任务调度程序认为 python 脚本仍在运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 python 脚本,它依次执行其他 python 脚本.我把它作为 WinXP 任务调度程序的一个任务.事情运行 - 命令提示符被打开,火花飞扬,魔法发生......最终任务完成,我得到了一个很好的'打印脚本结束!!'并返回提示.但是任务计划程序认为任务仍在运行!这反过来又会阻止它每天再次运行它.

I have a python script which in turn executes other python scripts. I put this as a task on WinXP task scheduler. the thing runs - command prompt is opened, sparks are flying, magic happens... eventually the task is completed, I get a nice 'print script ended!!' and back to prompt. but Task Scheduler thinks the task is still running ! which in turn prevents it from running it again on daily basis.

所以我尝试制作一个只调用脚本的 BAT 文件:

so I tried making a BAT file which just calls the script:

script.py echo pyfinished

令我惊讶的是,最后看不到 'pyfinished' ...

to my surprise cannot see 'pyfinished' at the end ...

推荐答案

我也有这个问题.我为确保脚本停止所做的是将任务配置为在 1 小时后停止(或脚本需要多长时间).这会终止任务,因此当任务计划再次出现时,启动就没有问题了.

I have this problem as well. What I did to make sure the script stops is configure the task to stop after 1 hour (or however long the script(s) should take). This kills the task and thus when the task schedule comes around again, it has no problem kicking off.

至于为什么Task Scheduler检测不到脚本完成,我不知道.这真是令人讨厌.

As for why Task Scheduler can't detect the script is finished, I have no idea. It's royally annoying.

更多推荐

任务调度程序认为 python 脚本仍在运行

本文发布于:2023-11-23 19:22:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622598.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   程序   python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!