How should I pass arguments when running Slicer in batch mode?

Everything after --python-script until the next recognizable flag is passed into the python interpreter:

Run:
./Slicer.exe --no-main-window --python-script test.py param1 param2 param3

Where test.py is:
print(sys.argv)

You will get this output on the console:
['test.py', 'param1', 'param2', 'param3']

3 Likes