Very small zlib/svg problem

Skip Montanaro skip at pobox.com
Wed Mar 27 17:43:25 EST 2002


    Fedor> I use the zlib library to compress the svg file.

    Fedor> The problem is that when I try to view the SVGZ file with adobe SVG viewer
    Fedor> 3.0 or with the Batik SVG browser that it doesn't render and is
    Fedor> not able to read the SVGZ file as SVG.

I think you want to use the gzip module.  Something like

    import gzip
    f = gzip.open("c:/test.svgz", "w")
    f.write(file('c:/test.svg').read())
    f.close()

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list