code: def merge_qpoints(self, workdir, files_to_merge, out_prefix):
          
          # We work with absolute paths.
          files_to_merge = [os.path.abspath(s) for s in list_strings(files_to_merge)]
          nfiles = len(files_to_merge)
  
          if self.verbose:
              print("Will merge %d files with output_prefix %s" % (nfiles, out_prefix))
              for (i, f) in enumerate(files_to_merge):
                  print(" [%d] %s" % (i, f))
  
          if nfiles == 1:
              raise self.Error("merge_qpoints does not support nfiles == 1")
  
          self.stdin_fname, self.stdout_fname, self.stderr_fname = \
              map(os.path.join, 3 * [workdir], ["mrgscr.stdin", "mrgscr.stdout", "mrgscr.stderr"])
  
          inp = StringIO()
          inp.write(str(nfiles) + "\n")     # Number of files to merge.
          inp.write(out_prefix + "\n")      # Prefix for the final output file:
  
          for filename in files_to_merge:
              inp.write(filename + "\n")   # List with the files to merge.
  
          inp.write("1\n")                 # Option for merging q-points.
  
          self.stdin_data = [s for s in inp.getvalue()]
  
          with open(self.stdin_fname, "w") as fh:
              fh.writelines(self.stdin_data)
              # Force OS to write data to disk.
              fh.flush()
              os.fsync(fh.fileno())
  
          self.execute(workdir)
docs: Execute mrgscr inside directory `workdir` to merge `files_to_merge`.
          Produce new file with prefix `out_prefix`