def write(filename, mesh, fmt_version, write_binary=True):
try:<EOL><INDENT>writer = _writers[fmt_version]<EOL><DEDENT>except KeyError:<EOL><INDENT>try:<EOL><INDENT>writer = _writers[fmt_version.split("<STR_LIT:.>")[<NUM_LIT:0>]]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>sorted(_writers.keys()), fmt_version<EOL>)<EOL>)<EOL><DEDENT><DEDENT>writer.write(filename, mesh, write_binary=write_binary)<EOL>
Writes a Gmsh msh file.