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 is supossed to create a file named errorlevel.py.
The debugger does not show any errors so the file is being opened, but it doesn't create a file.
I have tried using subprocess but didn't work either.
Inside the batch file there is :
@tasklist | find /i "WinRAR.exe"
@echo h = %errorlevel% > errorlevel.py
TaskFinder.batthen ?find /i winrar.exeusing e.g.subprocess.call(..., shell=True).