linux console command line history

kaklis at gmail.com kaklis at gmail.com
Tue Jul 20 19:12:32 EDT 2010


On Jul 21, 12:47 am, Benjamin Kaplan <benjamin.kap... at case.edu> wrote:
> On Tue, Jul 20, 2010 at 2:38 PM, kak... at gmail.com <kak... at gmail.com> wrote:
> > Hi to all,
> > I 'm writing a linux console app with sockets. It's basically a client
> > app that fires commands in a server.
> > For example:
> > $log user 55
> > $sessions list
> > $server list etc.
> > What i want is, after entering some commands, to press the up arrow
> > key and see the previous commands that i have executed.
> > Any hints? Any examples?
>
> > Antonis
> > --
>
> Look at the readline module.http://docs.python.org/library/readline.html

ok that's fine, thanks.
I have also find a very helpful example in PyMoTW
http://www.doughellmann.com/PyMOTW/readline/index.html(Thanks
Doug!!!).
But if i want to run this in it's own separate thread, how could i do
that?
there is an
# Prompt the user for text
input_loop()

which is blocking?



Antonis K.



More information about the Python-list mailing list