Last active
February 19, 2016 20:39
-
-
Save copyleftdev/892ae902677a9a98f34c to your computer and use it in GitHub Desktop.
recursivly decompress bz2 file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for filename in files: | |
| filepath = os.path.join(dirpath, filename) | |
| newfilepath = os.path.join(dirpath, filename + '.decompressed') | |
| with open(newfilepath, 'wb') as new_file, bz2.BZ2File(filepath, 'rb') as file: | |
| for data in iter(lambda : file.read(100 * 1024), b''): | |
| new_file.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment