Skip to content
Søren Roug edited this page Jul 13, 2014 · 1 revision

Load and save

This script simply loads a document into memory and saves it again. It takes the filename as argument.

import sys
from odf.opendocument import load
infile = sys.argv[1]
doc = load(infile)
outfile = infile[:-4] + "-bak" + infile[-4:]
doc.save(outfile)
Clone this wiki locally