def create_gzipped_copy(in_path, out_path, command=None):
 if command:
  subprocess.check_call(shlex.split(command.format(filename=in_path)))
 else:
  with gzip.GzipFile(out_path, 'wb+') as outf:
   with open(in_path, 'rb') as inf:
    outf.write(inf.read())

def create_gzipped_copy ( in_path , out_path , command = None ) : if command : subprocess . check_call ( shlex . split ( command . format ( filename = in_path ) ) ) else : with gzip . GzipFile ( out_path , 'wb+' ) as outf : with open ( in_path , 'rb' ) as inf : outf . write ( inf . read ( ) )
create gzipped copy of in_path and save it as out_path .