Extract gz file

I am trying to figure out how to extract a gz file in the python script. I would like to extract the content and then write it to a temporary file. The contents of the gz file is just a CSV text file.

I figured it out. There is some kind of work around for jython.

I put this before my code.

[code]import java
import org.python.core

import java.lang.StringBuffer as SB

for n,f in java.lang.AbstractStringBuilder.dict.items():
x = org.python.core.PyReflectedFunction(n)
for a in f.argslist:
if a is None: continue
m = SB.getMethod(n,a.args)
x.addMethod(m)
SB.dict[n] = x[/code]

to solve this error message

the rest of my code to extract the gz file looks like this

fn = 'C:\\folder\\file.gz' import gzip f = gzip.open(fn) #open read-binary file f with name fn print f.read()

Thats an impressive work-around. Glad you got it working.