How to run multiple P4C scripts located in different folders all at once

Dear Capella and P4C users,

I reach to you in case you have found yourself in a similar scenario:

I would like to launch (at once) a series of P4C scripts structured in a series of folders and subfolders, so that I can run the execution in one time rather than individually for each script. The following figure shows an example of what the P4C script structure could look like within the Python4Capella folder:

image

Any ideas?

Thanks in advance :slight_smile:
Carlos

You could define a function in each script you want to execute with the needed behavior. Then import and call each function in a top level script you could run. If you still want to be able to call each script directly, you just need to add a call to the defined function at the end of the script.
I think to do this you should use the Python import instead of the EASE include since it concatenate all included files before passing the result to Python.


set the ones you want to run and use a magic header to set how/when to run this file. Solution above runs in descending order.