path_prepend

typhon.utils.path_prepend(dirname, path='PATH')[source]

Prepend a directory to environment path variable.

Append entries to colon-separated variables (e.g. the system path). If the entry is already in the list, it is moved to the end. A path variable is set, if not existing at function call.

Parameters
  • dirname (str) – Directory to add to the path.

  • path (str) – Name of the path variable to append to. Defaults to the system path ‘PATH’.