Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- import xml.etree.ElementTree as etree
- filename = "sample.xml"
- __currentlocation__ = os.getcwd()
- __fullpath__ = os.path.join(__currentlocation__,filename)
- tree = etree.parse(__fullpath__)
- root = tree.getroot()
- hivetable = root.find("hive-table").text
- dburl = root.find("dburl").text
- username = root.find("username").text
- password = root.find("password").text
- tablename = root.find("tablename").text
- mappers = root.find("mappers").text
- tagertdir = root.find("tagert-dir").text
- print hivetable
- print dburl
- print username
- print password
- print tablename
- print mappers
- print tagertdir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement