9.1. pyopus.misc.env — Login shell environment

Login shell environment access module

This module portably handles environmental varibales. On some systems (Windows) the environment is the same for all applications. In Linux the environment depends on the type of the shell (login or non-login).

Usually only the login shell provides the full environment. This module imports the environmental variables by spawaning user’s login shell and collecting the environment from it.

Under Windows this is a trivial module. After being imported under Linux this module spawns a login shell, runs env.py and collects the environment on standard output.

If this module is run it dumps the environment in form of a json dictionary (json.dumps()) to standard output and exits.

pyopus.misc.env.environ

A dictionary with variable name for key holding the login shell’s environment.

Not automatically imported to the main PyOPUS module.