Running Salome directly from terminal

Hi there,
So I have been reading the SALOME KERNEL pages for running the salome scripts straight from terminal or powershell. Basically I have a working python script for use in salome. However instead of manually opening the Salome gui, selecting ‘load script’ and then repeating, I would like to do it from terminal.
However all the notes in SALOME KERNEL start with:
‘salome start [options] …’
or
‘salome shell [options] …’

https://docs.salome-platform.org/latest/tui/KERNEL/running_salome_page.html
Here is a link to the said salome kernel page I have mentioned.

I however do know where this directory is in the power shell? I have set my directory to C:\SALOME-9.12.0 and in there is run_salome.bat and a few others but I am completely lost as to how to locate myself so I can start using the commands from the SOLOME KERNEL reference page.

This is my first time trying to use terminal / powershell as I try to integrate using Salome with two other software directly from terminal.

Happy to explain further or clear any of that up.

Thanks :slight_smile: :slight_smile:

To run a Salome script from the terminal, at least in Linux, the command would be
$pathSalomeDirectory/salome -t script.py

1 Like

Thanks for the reply Franco.ota,

So I have tried this (on windows) and it usually prompts me to use notepad to open ‘salome’. I imagine instead this is meant to either open or run salome.

The notepad text which is prompted to open is a long python script. Most of it many lines of context.setVariable(…).
Any idea what is going on? I have been using Salome regularly from the GUI for a month now so would be surprised if I haven’t installed something. Though I read a bit about getting the kernel services.

on Windows, you need to run:

SALOME-9.12.0\W64\Python\python.exe SALOME-9.12.0\salome -t script.py

1 Like

This worked exactly, thanks!