import os
import time
def FindTask():
while True:
os.startfile('C:\\Users\\Joze\\Desktop\\League Bot\\TaskFinder.bat')
time.sleep(2)
from errorlevel import h
if h == 0:
print("is")
elif h == 1:
print("no")
FindTask()
TaskFinder.bat
可以创建一个名为的文件errorlevel.py
。
调试器不会显示任何错误,因此正在打开文件,但不会创建文件。
我曾尝试使用,subprocess
但也无法正常工作。
在批处理文件中有:
@tasklist | find /i "WinRAR.exe"
@echo h = %errorlevel% > errorlevel.py
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句