import xml.dom.minidomimport osimport sysimport zipfileimport shutilimport datetimefrom os import pathdef main(): #working with xml doc=xml.dom.minidom.parse("samplexml.xml"); print doc.nodeName print doc.childNodes print doc.firstChild.tagName skills = doc.getElementsByTagName("skill") print("%d skill " % skills.length) counter = 0 for skill in skills: counter +=1 print "Skill # ",counter,"-",skill.getAttribute("name") newSkill=doc.createElement("skill") newSkill.setAttribute("name","JavaScript") doc.firstChild.appendChild(newSkill) skills = doc.getElementsByTagName("skill") print ("%d Skill " % skills.length) for skill in skills: print skill.getAttribute("name") xmlfile = "samplexml.xml" fh = open(xmlfile) counter = 0 for line in fh: counter +=1 if line.startswith(" 1 : print "there are " ,len(sys.argv) -1 ,'arguments' for arg in sys.argv[1:]: print argelse:print "there are no argument"# checking host platformprint sys.platform # win32if sys.platform=="win32": import ntpath pathmodule = ntpathprint pathmodule # out put#redirect outputold = sys.stdoutsys.stdout=open("output.txt",'w')print "this file should be print into file output.txt"sys.stdout=oldprint "come back "