Here's code.
import os
import signal
import time
pid = os.getpid()
timeStart = time.time()
timeEnd = time.time() + 5
while True:
timeSpend = 5 - int(time.time() - timeStart)
print "%02d Seconds Left" % timeSpend
time.sleep(1)
if timeEnd <= time.time():
print "DONE!!!!!!"
time.sleep(1)
os.kill(pid, signal.SIGTERM)
It works good in my console bash.
But when i try this code in scheduled task, It's not good.
There is just 'terminated' message in log.
How can i print message right?