There are plenty of newer posts with a shorter script for converting meshes with meshio, see for instance: Circular mesh looks not okay - #5 by dokken
or if you move to DOLFINx:
Using the GMSH Python API to generate complex meshes | Jørgen S. Dokken
1 Like