Python for MS-DOS (was: Re: RS232 support for DOS on 486?)

Oleg Broytmann phd at phd.fep.ru
Tue Jun 12 18:08:59 EDT 2001


On 12 Jun 2001, Cyril Slobin wrote:
> So, weekend passes, and Python 2.1 is successfully compiled with DJGPP.
> Very similar to Python-DX, but with less built-in modules (yet). I myself

   Congratilation!

> use it instead of standart Python for Windows because of better readline

   Do you know you can put this into init.py (I hope your Python executes
init.py upon interactive startup) and have history load/save automatically?

# From Bruce Edge, http://groups.yahoo.com/group/python-list/message/128961

import rlcompleter, readline
#readline.parse_and_bind("tab: complete")
readline.parse_and_bind("tab: menu-complete")

import os
histfile="%s/.python-history" % os.environ["HOME"]
readline.read_history_file(histfile)

def savehist():
   global histfile
   readline.write_history_file(histfile)

import atexit
atexit.register(savehist)

> support (faster, working history file save/load). You can get it from:
>
>     ftp://ftp.ice.ru/pub/slobin/python/

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list