-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.py
More file actions
41 lines (34 loc) · 789 Bytes
/
Copy pathtime.py
File metadata and controls
41 lines (34 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
try:
import time
import sys
import os
#check file open by app
#check file open by app
if os.path.exists("process/run_by_app_02"):
os.remove("process/run_by_app_02")
else:
sys.exit()
sec = 0
close_req = False
while True:
#write time
try:
time_file = open("process/time","w")
time_file.write(str(sec))
time_file.close()
except:
pass
#seconds
sec += 1
time.sleep(1)
#check close status
try:
close_state = open("process/time_end","r")
close_state.close()
close_req = True
except:
pass
if close_req == True:
sys.exit()
except:
pass