python - How to read gzipped file from FTP server? -


i want read file public ftp server, , can't seem figure how use gzip , urllib efficiently, without explicitely downloading file opening gzip.open(). there other way possible @ all?

for example "ftp://ftp.server.com/pub/data/archive.gz" link got. right way read contents file in python?


edit:

so ended using:

g = gzip.open(urllib.urlretrieve(url)[0])

argument gzip.open() way temp file downloaded url path, , g regular file object representing archive contents

what might work read memory , unzip it, problem end using tons of memory, hence it's better download rather dowloading memory , manipulating there.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -