mirror of
https://github.com/rasbt/python_reference.git
synced 2024-11-27 22:11:13 +00:00
Update conc_gzip_files.py
This commit is contained in:
parent
8c3461624f
commit
86c23d5123
|
@ -14,9 +14,9 @@ def conc_gzip_files(in_dir, out_file, append=False):
|
||||||
else creates a new output file.
|
else creates a new output file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
write_mode = 'bw'
|
write_mode = 'wb'
|
||||||
if append:
|
if append:
|
||||||
write_mode = 'ba'
|
write_mode = 'ab'
|
||||||
gzips = [os.path.join(in_dir, i) for i in os.listdir(in_dir) if i.endswith('.gz')]
|
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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user