Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16475

Re: Disable readline

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: Disable readline
Date 2011-12-01 00:00 -0500
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-9B9489.00005201122011@news.panix.com> (permalink)
References <4ed6ffed$0$29986$c3e8da3$5496439d@news.astraweb.com>

Show all headers | View raw


In article <4ed6ffed$0$29986$c3e8da3$5496439d@news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:

> Is there a way to disable readline support in the interactive interpreter 
> at runtime? Either from within an existing session, or when the session 
> starts up will do.

I'm assuming Python uses the standard GNU readline().  If that's 
correct, then you can configure its behavior by editing your ~/.inputrc 
file.  Try "man readline".  I don't see any global "disable readline" 
flag, but you may be able to get that effect by deleting all the key 
mappings, or some such silliness.

Another possibility is setting your TERM environment variable to 
something that readline can't support:

~$ TERM=asr33
~$ python
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Cannot read termcap database;
using dumb terminal settings.
Cannot read termcap database;
using dumb terminal settings.
Cannot read termcap database;
using dumb terminal settings.
>>> 

 
> If all else fails, are there any traps or pitfalls in installing a second 
> Python installation with readline support disabled?

None at all, as long as you keep them from stomping on each other.  The 
easiest method is probably to use virtualenv.

BTW, readline is the coolest, awesomist, most frabjulously gnarly thing 
to be invented since the pointed stick.  The idea that somebody would 
want to turn it off (even for testing) disturbs me deeply.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Disable readline Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-01 04:17 +0000
  Re: Disable readline Roy Smith <roy@panix.com> - 2011-12-01 00:00 -0500
    Re: Disable readline Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-01 06:42 +0000
      Re: Disable readline Nick Dokos <nicholas.dokos@hp.com> - 2011-12-01 09:30 -0500

csiph-web