Code:
# Import system modules import sys, string, os, xml.dom.minidom from xml.dom.minidom import parse, parseString metadata_xml_file = "C:\\Temp\\county_simp2.shp.xml" parseXMLdoc = parse(metadata_xml_file)
# Import system modules import sys, string, os, xml.dom.minidom from xml.dom.minidom import parse, parseString metadata_xml_file = "C:\\Temp\\county_simp2.shp.xml" parseXMLdoc = parse(metadata_xml_file)
import zipfile, os, sys test1_zip = ("C:\\Temp\\test1.zip") folder_name = sys.argv[1] output_dir = "C:\\Temp\\" + folder_name z = zipfile.ZipFile(test1_zip, 'r') zList = z.namelist() for zItem in zList: print "Unpacking",zItem
import zipfile, os, sys zip1 = ("C:\\Temp\\test11.zip") z = zipfile.ZipFile(zip1, 'r') zList = z.namelist() for zItem in zList: print "Unpacking",zItem zRead = z.read(zItem) z1File
kmlTextFile = "C:\\Temp\\scriptTEST2.kml" f = open(kmlTextFile, "w") f.write(xmldoc.toxml())
f = open('filename', 'wb') f.write(xmldoc.toxml())
>>> from xml.dom import minidom >>> xmldoc = minidom.parse('~/diveintopython/common/py/kgp/binary.xml')
ws1 = wb.Worksheets(1) ws2 = wb.Worksheets(2) ws2.Cells(1,1).Value = "GREEN" ws2.Cells(2,1).Value = "YELLOW" ws2.Cells(3,1).Value = "RED" ws2.Cells(4,1).Value = "WHITE" ws2.Cells(5,1).Value = "NOT SURE" wb.Names.Add("ValidStatus", "=vl!R1C1:R5C1")
Sub Macro2() ' ' Macro2 Macro ' ' Sheets("Sheet2").Select Range("A1:A5").Select
import glob, os filelist=glob.glob('*.sid') print filelist for filename in filelist: print filename os.system(r"C:\Temp\mrsidsdw.exe
xlApp.ActiveWorkbook.SaveAs(csvOutFile, FileFormat=24)
Leave a comment: