[Gmsh] Python API and Spyder
cgeuzaine at uliege.be
Wed Apr 1 11:32:52 CEST 2020
> On 31 Mar 2020, at 11:59, paul francedixhuit <paul18fr at gmail.com> wrote:
> One would say this is not the "normal" use of the Gmsh API, but for my developments under Python, I'm always coding under Spyder IDE (and I would like to continue if possible).
> I've been noticing that when Gmsh GUI needs to be opened (t8.py case for example), then it becomes not possible to close it and it's necessary to close Spyder as well (of course it works fine in commande line).
> Can we imagine something like gmsh.close()?
> In addition as I've ever said in a previous post, Gmsh API can be used:
> • either by defining the PYTHONPATH as described in the doc (I've defined it in the .bashrc file)
> • either by explicitly implementing it at the beginning of the Python file (see sys.path.append)
> Find some screenshots in attachment
When you call gmsh.fltk.run(), FLTK basically runs a while(1) loop waiting for graphical interface events. To break the loop simply close the Gmsh window.
You can also run the event loop yourself in Python: don't call gmsh.fltk.run(), but gmsh.fltk.wait() each time to want to wait for an event. See demos/curstom_gui.py for a complete example.
> Stay at home
> gmsh mailing list
> gmsh at onelab.info
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
More information about the gmsh