InterviewSolution
| 1. |
What are Python-specific environment variables? |
|
Answer» After you install Python software on your computer, it is desired that you add the installation directory in your operating system’s PATH environment variable. Usually the installer program does this action by default. Otherwise you have to perform this from the control panel. In addition to updating PATH, certain other Python-specific environment variables should be set up. These environment variables are as follows:
This environment variable plays a role similar to PATH. It tells the Python interpreter where to locate the module files imported into a program. It includes the Python source library directory and other directories containing Python source code. PYTHONPATH is usually preset by the Python installer.
It denotes the path of an initialization file containing Python source code. This file is executed every time the Python interpreter starts. It is named as .pythonrc.py and it contains commands that load utilities or modify PYTHONPATH.
In Windows, it enables Python to find the first case-insensitive match in an import statement. Set this variable to any value to activate it.
It is an alternative module SEARCH path. It is usually embedded in the PYTHONSTARTUP or PYTHONPATH directories to make SWITCHING module libraries easy. It may refer to zipfiles containing pure Python modules (in either source or compiled form)
If this is set to a non-empty string it turns on parser debugging output.
If this is set to a non-empty string it is equivalent to specifying the -i OPTION. When a script is passed as the first argument or the -c option is used, enter interactive mode after executing the script or the command.
If this is set to a non-empty string it is equivalent to specifying the -v option causes PRINTING a message each time a module is initialized, showing the place from which it is loaded.
If this environment variable is set, sys.argv[0] will be set to its value instead of the value got through the C RUNTIME. Only works on Mac OS X. |
|