thats code is was opening bubbles.txt so i give it toai and did gave this code
from ctypes import Structure, windll, c_uint, sizeof, byref
import subprocess
import time
class LASTINPUTINFO(Structure):
fields = [
('cbSize', c_uint),
('dwTime', c_uint),
]
while True:
if get_idle_duration() < sleepTime: # we need to wait
time.sleep(sleepTime - get_idle_duration())
running = False
else:
if not running:
running = True
subprocess.Popen(['cmd.exe', '/c', bubbles])
This code working properly on my pc. Thank you anyway for this python code.
thats code is was opening bubbles.txt so i give it toai and did gave this code from ctypes import Structure, windll, c_uint, sizeof, byref import subprocess import time
class LASTINPUTINFO(Structure): fields = [ ('cbSize', c_uint), ('dwTime', c_uint), ]
def get_idle_duration(): lastInputInfo = LASTINPUTINFO() lastInputInfo.cbSize = sizeof(lastInputInfo) windll.user32.GetLastInputInfo(byref(lastInputInfo)) millis = windll.kernel32.GetTickCount() - lastInputInfo.dwTime return millis / 1000.0
bubbles = r"C:\Windows\System32\Bubbles.scr /s" running = False sleepTime = 2 * 60 # 2 minutes
while True: if get_idle_duration() < sleepTime: # we need to wait time.sleep(sleepTime - get_idle_duration()) running = False else: if not running: running = True subprocess.Popen(['cmd.exe', '/c', bubbles])
This code working properly on my pc. Thank you anyway for this python code.