Re: [Tutor] gzip

2011-08-08 Thread questions anon
Thank you and I will look into shutils, below is the code that did work: import gzip import os MainFolder=r"E:/data" for (path, dirs, files) in os.walk(MainFolder): for dir in dirs: print dir path=path+'/' for gzfiles in files: if gzfiles[-3:]=='.gz': pri

Re: [Tutor] gzip

2011-08-08 Thread Stefan Behnel
questions anon, 08.08.2011 01:57: Thank you, I didn't realise that was all I needed. Moving on to the next problem: I would like to loop through a number of directories and decompress each *.gz file and leave them in the same folder but the code I have written only seems to focus on the last fold

Re: [Tutor] gzip

2011-08-07 Thread questions anon
Thank you, I didn't realise that was all I needed. Moving on to the next problem: I would like to loop through a number of directories and decompress each *.gz file and leave them in the same folder but the code I have written only seems to focus on the last folder. Not sure where I have gone wrong

Re: [Tutor] gzip

2011-08-06 Thread Walter Prins
On 7 August 2011 01:52, questions anon wrote: > How can I output the decompressed file? something like: > output=file_content.write(filepath[:-3]) > > See here: http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files And here: http://docs.python.org/library/stdtypes.html#file.w

[Tutor] gzip

2011-08-06 Thread questions anon
Hi All, I am trying to decompress at gzipped netcdf file and place the decompressed file in the same folder without the *.gz extension. I am using gzip. If I use the following code nothing happens. import gzip filepath="D:/test/surfacetemp.nc.gz" compresseddata=gzip.open(filepath, "rb") file_conte

Re: [Tutor] gzip (fwd)

2004-12-05 Thread Liam Clarke
you're using the '-q' and '-r' options of the > 'zip' > > > > command line utility. '-q' stands for 'quiet' mode, and although > that's > > > > nice when the command is working properly, it's not helpful when > you're > >

Re: [Tutor] gzip (fwd)

2004-12-05 Thread Jacob S.
d is working properly, it's not helpful when you're > > > debugging a situation. Try turning quiet mode off, so that you have a > > > better chance of getting good error output from the zip command. Even > > > better, try enabling verbose mode, so you can see

Re: [Tutor] gzip (fwd)

2004-12-03 Thread Liam Clarke
on. Try turning quiet mode off, so that you have a > > better chance of getting good error output from the zip command. Even > > better, try enabling verbose mode, so you can see better what 'zip' is > > attempting to do. > > > > Do you see anything else when you execute the prog

Re: [Tutor] gzip (fwd)

2004-12-03 Thread Ramkumar Parimal Alagan
ry enabling verbose mode, so you can see better what 'zip' is > attempting to do. > > Do you see anything else when you execute the program? Does anything else > come out of standard error? > > Good luck to you. > > -- Forwarded message -- > Date:

Re: [Tutor] gzip (fwd)

2004-12-02 Thread Danny Yoo
at 'zip' is attempting to do. Do you see anything else when you execute the program? Does anything else come out of standard error? Good luck to you. -- Forwarded message -- Date: Fri, 3 Dec 2004 10:24:15 +0600 From: Ramkumar Parimal Alagan <[EMAIL PROTEC