Skip to main content
added 2 characters in body
Source Link
Jeremy
  • 1
  • 1
  • 4
  • 13

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r''rb') as compressed:
        with open(filename + '-decompressed', 'w''wb') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like this:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + '-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like this:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'rb') as compressed:
        with open(filename + '-decompressed', 'wb') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like this:

$ python expander.py data/*
Fix syntax errors and indentation
Source Link
Jakuje
  • 21.4k
  • 7
  • 53
  • 72

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + '-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like sothis:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + '-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like so:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + '-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like this:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + "'-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)
$ python expander.py data/*

Then run it like so:

$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + "-decompressed', 'w') as expanded:
        data = zlib.decompress(compressed.read())
        expanded.write(data)
$ python expander.py data/*

This might do it:

import glob
import zlib
import sys

for filename in sys.argv:
    with open(filename, 'r') as compressed:
        with open(filename + '-decompressed', 'w') as expanded:
            data = zlib.decompress(compressed.read())
            expanded.write(data)

Then run it like so:

$ python expander.py data/*
Post Migrated Here from stackoverflow.com (revisions)
Source Link
Jeremy
  • 1
  • 1
  • 4
  • 13
Loading