Merge files

def merge(self, path, outfile, infiles):
        """Merge files
        """
        with open(path + outfile, 'w') as out_f:
            for i in infiles:
                if os.path.isfile("{0}{1}".format(path, i)):
                    with open(path + i, "r") as in_f:
                        for line in in_f:
                            out_f.write(line)