简体   繁体   中英

task scheduler thinks python script is still running

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.

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

script.py
echo pyfinished

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

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.

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

包含os.system('cmd /K script.py')os.system('cmd /K script.py')该进程保持活动状态,直到我手动将其杀死为止。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM