On this page
  1. site.gethistoryfile
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

site.gethistoryfile

Prev: site.execusercustomize | Up: site | Next: site.getsitepackages
Rel: site.abs_paths, site.addpackage, site.addsitedir, site.addsitepackages
Ref: docs.python.org — site.gethistoryfile
Tags: #public #python3 #stdlib #site


Import

import site
from site import gethistoryfile

Signature & Overview

site.gethistoryfile()

Check if the PYTHON_HISTORY environment variable is set and define it as the .python_history file. If PYTHON_HISTORY is not set, use the default .python_history file.

Usage

import site

if hasattr(site, 'gethistoryfile'):
    assert isinstance(site.gethistoryfile(), str)

Gotchas

REPL Inspect

from site import gethistoryfile
help(gethistoryfile)

Linked from

Related notes