Running Python scripts of OOFEM inside CLion

OOFEM has some parts written in python (*.py) such as unv2oofem used for preprocessing and extractor used for postprocessing.

To run these scripts first make sure you have setup the python interpreter (see here)

Next simply open the python script such as /tools/unv2oofem/unv2oofem.py by openning the script and right click on the file tab and clicking “run…”

Notice that the file is now added to select run/debug drop-down menu next to the hammer button:

Chances are you get “Process finished with exit code 127” in that case

In that case:

  1. select edit configuratins… from select run/debug menu
  2. Uncheck Add content roots to PYTHONPATH and Add source roots to PYTHONPATH.
  3. You may want to modify the Parameters and Working directory options accordingly depending on what you want to do.

More information:

Resolving exit code 127 error on Stackoverflow

One thought on “Running Python scripts of OOFEM inside CLion

Leave a comment

Design a site like this with WordPress.com
Get started