-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
83 lines (73 loc) · 1.9 KB
/
main.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python
# coding:utf-8
# | |
# --+----------------------------------------------------------+--
# | Code by : yasserbdj96 |
# | Email : [email protected] |
# | Github : https://github.com/yasserbdj96 |
# | BTC : bc1q2dks8w8uurca5xmfwv4jwl7upehyjjakr3xga9 |
# --+----------------------------------------------------------+--
# | all posts #yasserbdj96 ,all views my own. |
# --+----------------------------------------------------------+--
# | |
#START{
from datetime import datetime
now = datetime.now()
# Using readlines()
file1=open('map.txt','r')
Lines=file1.readlines()
l1=[*Lines[0].strip()]
l2=[*Lines[1].strip()]
l3=[*Lines[2].strip()]
l4=[*Lines[3].strip()]
l5=[*Lines[4].strip()]
l6=[*Lines[5].strip()]
l7=[*Lines[6].strip()]
l=min([len(l1),len(l2),len(l3),len(l4),len(l5),len(l6),len(l7)])
c=[]
for i in range(0,l):
c.append(l1[i])
c.append(l2[i])
c.append(l3[i])
c.append(l4[i])
c.append(l5[i])
c.append(l6[i])
c.append(l7[i])
f=open('last.txt','r')
g=f.readlines()[0].strip()
Line=int(g.split(":")[0])
dayis=int(g.split(":")[1])
f.close()
wd=now.weekday()
#wd=6
if Line==-1:
if wd==6:
work=True
else:
work=False
else:
work=True
if work==True and wd!=dayis:
f=open('last.txt','w')
f.write(f'{Line+1}:{wd}')
#Line+=1
f.close()
print(1)
elif Line+1==len(c):
f=open('last.txt','w')
f.write('-1:2')
#Line+=1
f.close()
print(1)
elif Line==-1:
print(0)
else:
#print(c[Line])
if int(c[Line])==1:
f=open("empty.md", "w+")
f.write(f'last update at : {now.strftime("%d/%m/%Y %H:%M:%S")} (UTC)')
f.close()
print(1)
else:
print(0)
#}END.