command prompt history filtered by initial letters

L

limit

Hello,

On WindowsXP with Python 2.5.1 (from the python-2.5.1.msi): when I'm
at the python prompt, up-arrow scrolls through the command history. If
I type group of characters first, up-arrow shows only the previous
commands that start with that group of characters.

On CentOS 5 with Python 2.5.4 (that I built locally): up-arrow does
not filter the command history based on initial characters at the
prompt.

How do I get this command history filter working on the centos
install? I see that <ctrl-r> allows history search. That is the
workaround.

Sorry if this is a double-post.

--Todd
 
L

limit

Oops, pardon the double-post.

Doesn't python invoke its own shell? On windows I start by running c:
\WINDOWS\system32\cmd.exe. But then I run 'python' and get the ">>>"
prompt. The same thing happens from a bash or tcsh shell on Linux,
right? Are you saying that OS-specific shell capabilities are
inherited by the python shell?
 
M

MRAB

limit said:
Oops, pardon the double-post.

Doesn't python invoke its own shell? On windows I start by running c:
\WINDOWS\system32\cmd.exe. But then I run 'python' and get the ">>>"
prompt. The same thing happens from a bash or tcsh shell on Linux,
right? Are you saying that OS-specific shell capabilities are
inherited by the python shell?
You're running Python in a console/shell window. Python calls the
console for a line of input and the call doesn't return until the
Enter/carriage return key is pressed. All the fancy history stuff is a
feature of the console, not Python.
 
L

limit

You're running Python in a console/shell window. Python calls the
console for a line of input and the call doesn't return until the
Enter/carriage return key is pressed. All the fancy history stuff is a
feature of the console, not Python.

Understood, thank you!
 
A

alex23

How do I get this command history filter working on the centos
install? I see that <ctrl-r> allows history search. That is the
workaround.

If you can, try installing & using iPython instead:
http://ipython.scipy.org/

Along with a wealth of other useful features, it provides exactly the
kind of history behaviour you're looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,743
Latest member
WoodrowMea

Latest Threads

Top