Define default directory for qt (input) dialog#

Sometime if can be inconvenient to browse path in order to provide a location to file or a dataset (like for the scan selector…). A solution can be to use the ‘TOMWER_DEFAULT_INPUT_DIR’ environment variable to define the default location of those dialogs. You can of course do it before launching tomwer from the terminal:

export TOMWER_DEFAULT_INPUT_DIR={location}

But you can also run such a processing from a ‘python’ widget.

import os
os.environ["TOMWER_DEFAULT_INPUT_DIR"] = "my/new/default/path"

Warning

do not forget to execute (run) to active the new environment variable