Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. text1
  2. text2
  3. text3
  4. -----Ending Step for step1-----
  5. -----Starting Step for step2-----
  6. text4
  7. text5
  8. text6
  9. -----Starting Step for step3-----
  10. text7
  11. text8
  12. text9
  13. -----Ending Step for step3-----
  14.  
  15. text10
  16. text11
  17. text12
  18. -----Ending Step for step2-----
  19.  
  20. with tag('html'):
  21. with tag('body'):
  22. with tag('pre'):
  23. for line in f:
  24. value=re.findall(r'Starting Step for (w+)',line)
  25. new_value=re.findall(r'Ending Step for (w+)',line)
  26. if value not in parent_tag_stop and value not in parent_tag_start:
  27. if parent_tag_start:
  28. parent_tag_start.append(value)
  29. else:
  30. child_tag[parent_tag_start[-1]] =value
  31.  
  32. elif new_value:
  33. parent_tag_stop.append(value)
  34. if tag==new_value[0]:
  35. with tag('a', href='#{0}'.format(new_value)):
  36. text(value)
  37. value=''
  38. else:
  39. value+=line```
  40.  
  41. 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