Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import os
  2. import os.path
  3.  
  4. home = os.getenv("a_HOME")
  5. filepath = os.path.join(home, "components", "xxx", "etc", "static-data", "GenericEntityList.xml")
  6. with open(filepath, 'r') as f:
  7. for line in f:
  8. print(line)
  9. lines = f.readlines()
  10. f.close()
  11. home = os.getenv("b_home")
  12. filepath = os.path.join(home, "components", "xxx", "etc", "static-data", "GenericEntityList.xml")
  13. with open(filepath, 'r') as f:
  14.  
  15. for line in f:
  16. if line!='</generic-entity-list>'+'\n':
  17. f.write(line)
  18. f.write('<entity>xx1</entity>\n')
  19. f.write('<entity>xx2</entity>\n')
  20. f.write('</generic-entity-list>\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement