Raw_input with readline in a daemon thread makes terminal text disappear
Aahz
aahz at pythoncraft.com
Mon Oct 19 15:39:52 EDT 2009
In article <mailman.1448.1255618675.2807.python-list at python.org>,
John O'Hagan <research at johnohagan.com> wrote:
>
>I'm getting input for a program while it's running by using raw_input in a
>loop in separate thread. This works except for the inconvenience of not having
>a command history or the use of backspace etc.
>
>That can be solved by loading the readline module; however, it results in a
>loss of visible access to the terminal when the program ends: nothing is
>echoed to the screen and the history is invisible (although it is there -
>hitting return executes whatever should be there normally). The only way to
>get it back is to close the terminal and open a new one.
Can you restructure your program so that input gets handled in the main
thread?
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
Member of the Groucho Marx Fan Club
More information about the Python-list
mailing list