May-08-2018, 11:08 AM
Hi all,
I'm using the gnureadline module (under Python 2.7) to allow input editing for a shell-like environment. However, when larger copy buffers should be sent, the added gnureadline features are more of a burden (escaping characters etc), so I look for a way to turn off the whole gnureadline temporarily, something like (simplified)
Thanks in advance,
Andy
I'm using the gnureadline module (under Python 2.7) to allow input editing for a shell-like environment. However, when larger copy buffers should be sent, the added gnureadline features are more of a burden (escaping characters etc), so I look for a way to turn off the whole gnureadline temporarily, something like (simplified)
import gnureadline while True: line = raw_input('') if line.startswith(":r"): # raw mode <turn off gnureadline> if line.startswith(":g"): # gnu mode <turn on gnureadline> if line == 'stop': break print 'ENTERED: "%s"' % lineIs there a way to do this? There are of course workarounds, like reading from file (which I currently use), but I still wonder.
Thanks in advance,
Andy