From 718b5f46a4acac4ef9450b372a980f916d40fffd Mon Sep 17 00:00:00 2001 From: Death916 Date: Thu, 13 Feb 2020 12:09:32 -0800 Subject: [PATCH] formatting --- minestart.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/minestart.py b/minestart.py index 259898b..5529dfa 100644 --- a/minestart.py +++ b/minestart.py @@ -17,14 +17,14 @@ def checkgpu(): return 'isavailable' if isavailable == [0]: - print("cant mine") - time.sleep(5) + print("gpu in use") + gpu.showUtilization() + time.sleep(500) return 'notavailable' def findProcessIdByName(processName): - listOfProcessObjects = [] # Iterate over the all the running process @@ -47,35 +47,27 @@ def checkminer(): else: return "running" + def killminer(): miner = findProcessIdByName('ccminer.exe') pid = miner[0]['pid'] psutil.Process(pid).kill() print('killed miner') -def startminer(): - psutil.Popen(['E:\downloads\ccminer.bat'], creationflags=CREATE_NEW_CONSOLE) +def startminer(): + psutil.Popen(['E:\downloads\ccminer.bat'], creationflags=CREATE_NEW_CONSOLE) while True: gpus = checkgpu() miner = checkminer() if gpus is 'isavailable' and miner is 'notrunning': - print('can start miner') + print('starting miner') startminer() time.sleep(30) if gpus is 'isavailable' and miner is 'running': killminer() time.sleep(30) - #kill miner - -#TODO: check for games running probably best way is to make a list of all games and check against list - - - - - - - +##TODO:check for games running probably best way is to make a list of all games and check against list