NB: Ta jest testowany tylko z pytona 2.
Kredyty: https://wiki.python.org/moin/PdbRcIdea
PDB używa readline więc możemy polecić readline uratować Historia:
.pdbrc
# NB: This file only works with single-line statements
import os
execfile(os.path.expanduser("~/.pdbrc.py"))
.pdbrc.py
def _pdbrc_init():
# Save history across sessions
import readline
histfile = ".pdb-pyhist"
try:
readline.read_history_file(histfile)
except IOError:
pass
import atexit
atexit.register(readline.write_history_file, histfile)
readline.set_history_length(500)
_pdbrc_init()
del _pdbrc_init
Która platforma używacie? – Keith
Ubuntu 11.04 Python 2.7.1+ (r271: 86832, kwi 11 2011, 18:13:53) [GCC 4.5.2] na linux2 – vkontori
Czy rozwiązałeś ten problem? Chciałbym również mieć podobną funkcję. – Phani