code: def create_tar (archive, compression, cmd, verbosity, interactive, filenames):
      
      mode = get_tar_mode(compression)
      try:
          with tarfile.open(archive, mode) as tfile:
              for filename in filenames:
                  tfile.add(filename)
      except Exception as err:
          msg = "error creating %s: %s" % (archive, err)
          raise util.PatoolError(msg)
      return None
docs: Create a TAR archive with the tarfile Python module.