Commit 998128e7 authored by 张彦钊's avatar 张彦钊

add print

parent 420781d7
import os import os
import time
def check(): def check():
out=os.popen("ps aux | grep diaryQueueUpdate.py").read() out = os.popen("ps aux | grep diaryQueueUpdate.py").read()
flag = False flag = 1
for line in out.splitlines(): for line in out.splitlines():
if 'python diaryQueueUpdate.py' in line: if 'python diaryQueueUpdate.py' in line:
flag = True flag = 2
return flag return flag
if __name__ == "__main__": if __name__ == "__main__":
if 1: while True:
os.popen('python diaryQueueUpdate.py') if check() == 1:
print(2) os.popen('python diaryQueueUpdate.py')
print("成功启动diaryQueueUpdate")
time.sleep(300)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment