1
我成功地在python中删除odt xml文件,但我不知道如何拉取xml文件数据?如何从python中检索odt xml文件中的数据?
任何技术都有拉动odt xml文件数据。
这里我提取ODT xml文件
#!/usr/lib/python2.7
import sys, zipfile
if len(sys.argv) < 2:
print "input.odt & output.xml"
sys.exit(0)
content=""
myfile = zipfile.ZipFile(sys.argv[1])
listoffiles = myfile.infolist()
for s in listoffiles:
if s.orig_filename == 'content.xml':
fd = open(sys.argv[2],'w')
content = myfile.read(s.orig_filename)
fd.write(content)
fd.close()