Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text1
- text2
- text3
- -----Ending Step for step1-----
- -----Starting Step for step2-----
- text4
- text5
- text6
- -----Starting Step for step3-----
- text7
- text8
- text9
- -----Ending Step for step3-----
- text10
- text11
- text12
- -----Ending Step for step2-----
- with tag('html'):
- with tag('body'):
- with tag('pre'):
- for line in f:
- value=re.findall(r'Starting Step for (w+)',line)
- new_value=re.findall(r'Ending Step for (w+)',line)
- if value not in parent_tag_stop and value not in parent_tag_start:
- if parent_tag_start:
- parent_tag_start.append(value)
- else:
- child_tag[parent_tag_start[-1]] =value
- elif new_value:
- parent_tag_stop.append(value)
- if tag==new_value[0]:
- with tag('a', href='#{0}'.format(new_value)):
- text(value)
- value=''
- else:
- value+=line```
- I want to split each block from starting step to ending step and create an html page with step1,step2 etc as anchor tags and the respective content as its text,step3 here will be child anchor under step 2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement