New submission from Barney Stratford:

I have a use case where a daemon thread needs to write periodic updates to 
sys.stdout. I'd prefer it not to print in the middle of a command being typed. 
In order to achieve this, I have added to the readline module. There is now a 
function to determine whether we are reading a line, and one to call 
rl_forced_update_display. These functions enable me to say (in the daemon 
thread):

def describe (indicator):
    if readline.reading_line ():
        print ()
        print (indicator.description)
        readline.forced_update_display ()
    else:
        print (indicator.description)


I have read PEP7, and have made patchtest on my patch.

----------
components: Library (Lib)
files: patch.txt
messages: 247424
nosy: Barney Stratford
priority: normal
severity: normal
status: open
title: Expand readline module
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40029/patch.txt

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24727>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to