-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_step.py
50 lines (47 loc) · 1.59 KB
/
get_step.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
import os
def search(key):
it = 0
f = open('index.php', 'r')
lines = f.readlines()
it = 0
img = []
images = []
steps = []
for i in lines:
if '===' in i:
if key in i:
while '===' not in lines[it + 1]:
#print(lines[it])
if '[[' in lines[it]:
img = lines[it]
it1 = 0
#print(img)
for c in img:
if c != '[':
it1 += 1
else :
break
img = img[it1 + 1:]
it1 = 0
for c in img:
if c != ':':
it1 += 1
else :
break
img = img[it1 + 1:]
it1 = 0
for c in img:
if c != '|':
it1 += 1
else:
break
img = img[:it1]
img = img.replace(' ', '-')
images.append(img)
steps.append(lines[it][:(len(lines[it])) - (len(img) + 18)])
print("The step is : ", lines[it][:(len(lines[it])) - (len(img) + 18)])
it += 1
it += 1
print("Images :\n", images)
print("Steps :\n", steps)
search("Sending")