A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/005549.html below:

[Python-Dev] oh, and any interest in my readline history stuff?

[Python-Dev] oh, and any interest in my readline history stuff?Guido van Rossum guido@beopen.com
Thu, 06 Jul 2000 02:00:49 -0500
> C-level changes are still required, but just to expose the existing
> functions in the GNU history library.  After responding to Fred's note, I
> realized that what I'm doing in rlcompleter.py:
> 
>     import os
>     histfile = os.getenv("PYTHONHISTORY")
>     if histfile is not None:
> 	try:
> 	    readline.read_history_file(histfile)
> 	except IOError:
> 	    pass
> 	import atexit
> 	atexit.register(readline.write_history_file, histfile)
>     del os, histfile
> 
> could just as easily be done in ~/.pythonrc.  Maybe I should retract the
> rlcompleter mods and just give something like
> 
>     import os
>     histfile = os.path.join(os.environ["HOME"], ".python_history")
>     try:
>         readline.read_history_file(histfile)
>     except IOError:
> 	pass
>     import atexit
>     atexit.register(readline.write_history_file, histfile)
>     del os, histfile
> 
> as an example in a yet-to-be-written libreadline.tex.

Yes, much better.

--Guido van Rossum (home page: http://dinsdale.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4