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

readline.add_history

Up: readline | Next: readline.clear_history
Rel: readline.clear_history, readline.get_begidx, readline.get_completer, readline.get_completer_delims
Ref: docs.python.org — readline.add_history
Tags: #public #python3 #stdlib #readline


Import

import readline
from readline import add_history

Signature & Overview

readline.add_history(string, /)

Add an item to the history buffer.

Usage

import readline

readline.add_history('demo_cmd')
assert readline.get_current_history_length() >= 1

Gotchas

REPL Inspect

from readline import add_history
help(add_history)

Linked from

Related notes