@@ -335,6 +335,8 @@ Miscellaneous options
335335Environment variables
336336---------------------
337337
338+ These environment variables influence Python's behavior.
339+
338340.. envvar :: PYTHONHOME
339341
340342 Change the location of the standard Python libraries. By default, the
@@ -350,7 +352,7 @@ Environment variables
350352
351353.. envvar :: PYTHONPATH
352354
353- Augments the default search path for module files. The format is the same as
355+ Augment the default search path for module files. The format is the same as
354356 the shell's :envvar: `PATH `: one or more directory pathnames separated by
355357 colons. Non-existent directories are silently ignored.
356358
@@ -400,6 +402,9 @@ Environment variables
400402 If this is set to a non-empty string it is equivalent to specifying the
401403 :option: `-i ` option.
402404
405+ This variable can also be modified by Python code using :data: `os.environ `
406+ to force inspect mode on program termination.
407+
403408
404409.. envvar :: PYTHONUNBUFFERED
405410
@@ -422,7 +427,40 @@ Environment variables
422427
423428.. envvar :: PYTHONDONTWRITEBYTECODE
424429
425- If given , Python won't try to write ``.pyc `` or ``.pyo `` files on the
430+ If this is set , Python won't try to write ``.pyc `` or ``.pyo `` files on the
426431 import of source modules.
427432
428433 .. versionadded :: 2.6
434+
435+
436+ .. envvar :: PYTHONEXECUTABLE
437+
438+ If this environment variable is set, ``sys.argv[0] `` will be set to its
439+ value instead of the value got through the C runtime. Only works on
440+ MacOS X.
441+
442+
443+ Debug-mode variables
444+ ^^^^^^^^^^^^^^^^^^^^
445+
446+ Setting these variables only has an effect in a debug build of Python, that is,
447+ if Python was configured with the :opt: `--with-pydebug ` build option.
448+
449+ .. envvar :: PYTHONTHREADDEBUG
450+
451+ If set, Python will print debug threading debug info.
452+
453+ .. versionchanged :: 2.6
454+ Previously, this variable was called ``THREADDEBUG ``.
455+
456+ .. envvar :: PYTHONDUMPREFS
457+
458+ If set, Python will dump objects and reference counts still alive after
459+ shutting down the interpreter.
460+
461+
462+ .. envvar :: PYTHONMALLOCSTATS
463+
464+ If set, Python will print memory allocation statistics every time a new
465+ object arena is created, and on shutdown.
466+
0 commit comments