import sys
#module for work with windows 32bit
import win32gui
txt=''
time1=time.time
#times dictionary
appdict=dict
while True:
#pause (it's influence to accuracy)
time.sleep5
#title of the current window
newtxt = win32gui.GetWindowText(win32gu
#if window was changed than update time of beginning work with other window
if txt!=newtxt:
time2=time.time
#add previous time to dict
if appdict.gettxt!=None:
appdicttxt=appdicttxt+roun
else:
appdicttxt=roundtime2,0-ro
txt=newtxt
time1=time.time
f=open′timerep.csv′,′w′
csvwr = csv.writer(f, delimiter=';',lineterminator='
#We write only window that summary time over 5 minutes (Other window is non-influential).
for i in appdict.items:
if i1>=300:
csvwr.writerowi
f.close
Комментариев нет:
Отправить комментарий