Advertisement
Guest User

Untitled

a guest
Jan 19th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/usr/bin/python
  2. import os
  3. import xml.etree.ElementTree as etree
  4. filename = "sample.xml"
  5. __currentlocation__ = os.getcwd()
  6. __fullpath__ = os.path.join(__currentlocation__,filename)
  7. tree = etree.parse(__fullpath__)
  8. root = tree.getroot()
  9. hivetable = root.find("hive-table").text
  10. dburl = root.find("dburl").text
  11. username = root.find("username").text
  12. password = root.find("password").text
  13. tablename = root.find("tablename").text
  14. mappers = root.find("mappers").text
  15. tagertdir = root.find("tagert-dir").text
  16. print hivetable
  17. print dburl
  18. print username
  19. print password
  20. print tablename
  21. print mappers
  22. print tagertdir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement