Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib64 /
python2.7 /
Demo /
xml /
Delete
Unzip
Name
Size
Permission
Date
Action
elem_count.py
1.14
KB
-rw-r--r--
2013-05-11 23:32
elem_count.pyc
1.79
KB
-rw-r--r--
2025-11-12 09:25
elem_count.pyo
1.79
KB
-rw-r--r--
2025-11-12 09:25
roundtrip.py
1.2
KB
-rw-r--r--
2013-05-11 23:32
roundtrip.pyc
2.31
KB
-rw-r--r--
2025-11-12 09:25
roundtrip.pyo
2.31
KB
-rw-r--r--
2025-11-12 09:25
rss2html.py
2.27
KB
-rw-r--r--
2013-05-11 23:32
rss2html.pyc
2.63
KB
-rw-r--r--
2025-11-12 09:25
rss2html.pyo
2.63
KB
-rw-r--r--
2025-11-12 09:25
Save
Rename
""" A simple demo that reads in an XML document and displays the number of elements and attributes as well as a tally of elements and attributes by name. """ import sys from collections import defaultdict from xml.sax import make_parser, handler class FancyCounter(handler.ContentHandler): def __init__(self): self._elems = 0 self._attrs = 0 self._elem_types = defaultdict(int) self._attr_types = defaultdict(int) def startElement(self, name, attrs): self._elems += 1 self._attrs += len(attrs) self._elem_types[name] += 1 for name in attrs.keys(): self._attr_types[name] += 1 def endDocument(self): print "There were", self._elems, "elements." print "There were", self._attrs, "attributes." print "---ELEMENT TYPES" for pair in self._elem_types.items(): print "%20s %d" % pair print "---ATTRIBUTE TYPES" for pair in self._attr_types.items(): print "%20s %d" % pair if __name__ == '__main__': parser = make_parser() parser.setContentHandler(FancyCounter()) parser.parse(sys.argv[1])