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)
Is 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
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)
1 2 3 4 5 6 7 8 9 10 |
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"' % line |
Thanks in advance,
Andy