mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-30 15:31:12 +00:00
Update conc_gzip_files.py
This commit is contained in:
parent
dd52d960f6
commit
98980fc77b
|
@ -17,7 +17,7 @@ def conc_gzip_files(in_dir, out_file, append=False):
|
||||||
write_mode = 'w'
|
write_mode = 'w'
|
||||||
if append:
|
if append:
|
||||||
write_mode = 'a'
|
write_mode = 'a'
|
||||||
gzips = [os.path.join(in_dir, i) for i in os.listdir(in_dir) if i.endswith(i)]
|
gzips = [os.path.join(in_dir, i) for i in os.listdir(in_dir) if i.endswith('.gz')]
|
||||||
with open(out_file, write_mode) as ofile:
|
with open(out_file, write_mode) as ofile:
|
||||||
for f in gzips:
|
for f in gzips:
|
||||||
with gzip.open(f, 'rb') as gzipf:
|
with gzip.open(f, 'rb') as gzipf:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user