code: def write(filename, mesh, fmt_version, write_binary=True):
      
      try:
          writer = _writers[fmt_version]
      except KeyError:
          try:
              writer = _writers[fmt_version.split(".")[0]]
          except KeyError:
              raise ValueError(
                  "Need mesh format in {} (got {})".format(
                      sorted(_writers.keys()), fmt_version
                  )
              )
  
      writer.write(filename, mesh, write_binary=write_binary)
docs: Writes a Gmsh msh file.