-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprintData.py
69 lines (56 loc) · 1.57 KB
/
printData.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
def write_into_file(path, x):
with open(path, "ab") as f:
f.write(str(x).encode("utf-8"))
def reset_file(path):
f = open(path, "w")
f.write("")
f.close
def print_file_info(path):
f = open(path, 'r',encoding="utf-8")
content = f.read()
f.close()
return(content)
matches = print_file_info("match.txt").split("\n")
matches = sorted(matches)
results = print_file_info("result.txt").split("\n")
results = sorted(results)
odds = print_file_info("odds.txt").split("\n")
odds = sorted(odds)
percent = print_file_info("percent.txt").split("\n")
percent = sorted(percent)
name = print_file_info("league.txt").split("\n")
name = sorted(name)
reset_file("result.txt")
reset_file("percent.txt")
reset_file("match.txt")
reset_file("odds.txt")
reset_file("league.txt")
for m in matches:
if len(m) > 1 and " " in m:
m = m.split(" ",1)
print(m[1])
write_into_file("match.txt", m[1] + "\n")
for m in results:
if len(m) > 1 and " " in m:
m = m.split(" ",1)
print(m[1])
write_into_file("result.txt",m[1]+"\n")
for m in odds:
if len(m) > 1 and " " in m:
m = m.split(" ",1)
print(m[1])
write_into_file("odds.txt",m[1]+"\n")
for m in percent:
if len(m) > 1 and " " in m:
m = m.split(" ",1)
print(m[1])
write_into_file("percent.txt",m[1]+"\n")
for m in name:
if len(m) > 1 and " " in m:
m = m.split(" ",1)
print(m[1])
write_into_file("league.txt",m[1]+"\n")
# print(matches)
# print(results)
# print(odds)
# print(percent)