Re: Baffled by readline module

2023-03-10 Thread Cameron Simpson
On 10Mar2023 23:11, Weatherby,Gerard wrote: This is the implementation of cmd.Cmd (Python 3.9). As you can see in cmdloop(), the import is already wrapped, and the readline feature can be turned off explicitly by passing None to the completekey in the constructor. This isn't strictly

Re: Baffled by readline module

2023-03-10 Thread Weatherby,Gerard
This is the implementation of cmd.Cmd (Python 3.9). As you can see in cmdloop(), the import is already wrapped, and the readline feature can be turned off explicitly by passing None to the completekey in the constructor. def __init__(self, completekey='tab', stdin=None, s

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
t;> functionality may be provided internally by readline. I’ve never had >>> to dig into it because it meets my needs out of the box. >> >>Apparently the cmd.Cmd docs are wrong. It says: >> >> If the readline module is loaded, input will automatically >>

Re: Baffled by readline module

2023-03-10 Thread Cameron Simpson
On 10Mar2023 09:12, Grant Edwards wrote: On 2023-03-10, Weatherby,Gerard wrote: On our Linux systems, I can up-arrow to go back to prior commands and use the left and right arrows to navigate a line. The functionality may be provided internally by readline. I’ve never had to dig into it

Re: Baffled by readline module

2023-03-10 Thread Eryk Sun
On 3/9/23, Greg Ewing via Python-list wrote: > On 10/03/23 4:00 pm, 2qdxy4rzwzuui...@potatochowder.com wrote: >> My ~/.pythonrc contains the following: >> >> import readline >> import rlcompleter >> readline.parse_and_bind( 'tab: complete

Re: Baffled by readline module

2023-03-10 Thread Simon Ward
nd editing. According to the page above, that's provided by the readline module There is also prompt_toolkit[1] for even more fancy command‐line handling. The documentation even states it “can be a very advanced pure Python replacement for GNU readline, but it can also be used for build

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Weatherby,Gerard wrote: > On our Linux systems, I can up-arrow to go back to prior commands > and use the left and right arrows to navigate a line. The > functionality may be provided internally by readline. I’ve never had > to dig into it because it meets my needs ou

Re: Baffled by readline module

2023-03-10 Thread Weatherby,Gerard
On our Linux systems, I can up-arrow to go back to prior commands and use the left and right arrows to navigate a line. The functionality may be provided internally by readline. I’ve never had to dig into it because it meets my needs out of the box. From: Python-list on behalf of Grant

Re: Baffled by readline module

2023-03-10 Thread Grant Edwards
On 2023-03-10, Weatherby,Gerard wrote: > I would say, “No, readline is not the right tool.” > > cmd.Cmd is: https://docs.python.org/3/library/cmd.html. I have a > couple of cmd.Cmd modules, one of which I use daily and the other > weekly. I'll have to remember that one. It d

Re: Baffled by readline module

2023-03-10 Thread Weatherby,Gerard
I would say, “No, readline is not the right tool.” cmd.Cmd is: https://docs.python.org/3/library/cmd.html. I have a couple of cmd.Cmd modules, one of which I use daily and the other weekly. From: Python-list on behalf of Grant Edwards Date: Thursday, March 9, 2023 at 2:29 PM To: python-list

Re: Baffled by readline module

2023-03-10 Thread gene heskett
On 3/9/23 20:31, 2qdxy4rzwzuui...@potatochowder.com wrote: I was with you until that part of the small wooden box. :-) So was I, but we all put that off as long as we can. I retired 22 years ago. We're not really an industry that has a concept of retirement. Which is why I'm still here (

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 4:00 pm, 2qdxy4rzwzuui...@potatochowder.com wrote: My ~/.pythonrc contains the following: import readline import rlcompleter readline.parse_and_bind( 'tab: complete' ) I don't have a ~/.pythonrc, so that's not what's doing it

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 2:57 pm, Chris Angelico wrote: import sys; "readline" in sys.modules Is it? Yes, it is -- but only when using the repl! If I put that in a script, I get False. My current theory is that it gets pre-imported when using Python interactively because the repl itself uses it

Re: Baffled by readline module

2023-03-09 Thread 2QdxY4RzWzUUiLuE
On 2023-03-09 at 19:11:56 -0800, Grant Edwards wrote: > On 2023-03-10, 2qdxy4rzwzuui...@potatochowder.com > <2qdxy4rzwzuui...@potatochowder.com> wrote: > If you run this application from the command line, you get command > recall and editing when entering strings at the "cmd:" prompt? > > #!/u

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
46 pm, Grant Edwards wrote: >> > > That's not how it acts for me. I have to "import readline" to get >> > > command line recall and editing. >> > >> > Maybe this has changed? Or is platform dependent? >> > >> > With Py

Re: Baffled by readline module

2023-03-09 Thread 2QdxY4RzWzUUiLuE
On 2023-03-10 at 12:57:48 +1100, Chris Angelico wrote: > On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list > wrote: > > > > On 10/03/23 1:46 pm, Grant Edwards wrote: > > > That's not how it acts for me. I have to "import readline" to

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list wrote: > > On 10/03/23 1:46 pm, Grant Edwards wrote: > > That's not how it acts for me. I have to "import readline" to get > > command line recall and editing. > > Maybe this has changed? Or is pla

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 1:46 pm, Grant Edwards wrote: That's not how it acts for me. I have to "import readline" to get command line recall and editing. Maybe this has changed? Or is platform dependent? With Python 3.8 on MacOSX I can use up arrow with input() to recall stuff I've t

Re: Baffled by readline module

2023-03-09 Thread 2QdxY4RzWzUUiLuE
On 2023-03-10 at 11:02:52 +1100, Chris Angelico wrote: > Traditional retirement: Work till you're 60 or 65 or whatever, then > society pats you on the head, calls you a "senior citizen", and lets > you go and be idle till you die (which might be prematurely soon). Sounds like Free Four¹: The

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
nput() built-in. >> >> Having a module modify the behavior of a built-in makes me cringe. > > Importing the module is not modifying the built-in. > > If your Python has been compiled with gnu readline support, > input() *already* provides recall and editing facilities.

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 12:43 pm, Grant Edwards wrote: When a computer dies, I generally just cp -a (or rsync -a) $HOME to a new one. Same here, more or less. My current machine has multiple archaeological layers going back about 5 generations of technology... -- Greg -- https://mail.python.org/mailman/li

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 11:43 am, Chris Angelico wrote: import readline print("Pseudo-prompt: ", end="") msg1 = input() msg2 = input("Actual prompt: ") print(repr(msg1)) print(repr(msg2)) At each of the prompts, type a bit of text, then backspace it all the way. The actu

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
On 10/03/23 10:59 am, Cameron Simpson wrote: I think this might be the common case of a module which wraps another library It's not quite the same thing, though -- the library it wraps is already hooked into things behind the scenes in ways that may not be obvious. (Unless you're Dutch?) -- Gr

Re: Baffled by readline module

2023-03-09 Thread Greg Ewing via Python-list
rting the module is not modifying the built-in. If your Python has been compiled with gnu readline support, input() *already* provides recall and editing facilities. You only need to import the readline module if you want to change the configuration. Yes, it would be helpful if the docs fo

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
On Fri, 10 Mar 2023 at 10:51, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2023-03-09 at 15:02:53 -0800, > Grant Edwards wrote: > > > Yeesh. What's _really_ embarassing is that I just stumbled across a > > small test program with which I had apparently figured this out 10-12 > > years ago.

Re: Baffled by readline module

2023-03-09 Thread Cameron Simpson
ct as normal humans expect them to (as opposed to old nerds who predate such fancies). General improvement of the user experience. Another thing affected by readline is the cmd module, which will use it during the input step for completion _if the module is present_. And use it for the input i

Re: Baffled by readline module

2023-03-09 Thread 2QdxY4RzWzUUiLuE
On 2023-03-09 at 15:02:53 -0800, Grant Edwards wrote: > Yeesh. What's _really_ embarassing is that I just stumbled across a > small test program with which I had apparently figured this out 10-12 > years ago. Must be about time to retire... Retiring doesn't help. :-) I retired almost five yea

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Chris Angelico wrote: > On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote: > >> Yeesh. What's _really_ embarassing is that I just stumbled across a >> small test program with which I had apparently figured this out >> 10-12 years ago. Must be about time to retire... > > You expect

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
On Fri, 10 Mar 2023 at 10:04, Grant Edwards wrote: > > Yeesh. What's _really_ embarassing is that I just stumbled across a > small test program with which I had apparently figured this out 10-12 > years ago. Must be about time to retire... > You expect yourself to remember test programs you wrot

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Grant Edwards wrote: > On 2023-03-09, Cameron Simpson wrote: > >> [...] >>>It finally dawned on me after seeing an example I found elsewhere that >>>you don't call some module method to fetch the next user-entered line. >>> >>>You call the input() built-in. >> >> Ah. That's not ove

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
put read by input(). > > It doesn't actually change anything about the prompts provided by > input(). It changes the handling of the user input by input(). > > I guess I read it too literally. I must spend too much time with > computers. It does actually affect the prompts,

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Cameron Simpson wrote: > [...] >>It finally dawned on me after seeing an example I found elsewhere that >>you don't call some module method to fetch the next user-entered line. >> >>You call the input() built-in. > > Ah. That's not overtly stated? [...reads...] Ah, there it is in t

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
d do with being a bullet list of use cases. ... and this. With a lot of "just wrap that library" functions, it can be exactly as you say: a bit of documentation about each function, and you can skim those to see what's available. But with readline, there isn't a "give me a

Re: Baffled by readline module

2023-03-09 Thread Cameron Simpson
insult the reader by saying nearly nothing ("this is just GNU readline, hooked to Python!") I'm looking at you, many "man" pages on a GNU based system which say "oh just go and read GNI info, it's all over there" - be detailed enough to enumerate the

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
uiltin, as is mentioned, but mainly, the module is to configure readline, not to ask for a line of text. It's a bit confusing, but very useful. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
e the feature and leave it at the defaults. Indeed, that seems to be how it works (though I never found that stated anywhere in the docs). What's really weird about the docs is that when it is described it doesn't even _mention_ that it provides command-line recall and editing: Th

Re: Baffled by readline module

2023-03-09 Thread Chris Angelico
On Fri, 10 Mar 2023 at 06:28, Grant Edwards wrote: > > In an interactive command-line Python program on Linux, I want to be > able to read a line at a time from stdin, providing command line > history and editing to the user. In C, I would use GNU readline to do > that. >

Re: Baffled by readline module

2023-03-09 Thread Grant Edwards
On 2023-03-09, Grant Edwards wrote: > In an interactive command-line Python program on Linux, I want to be > able to read a line at a time from stdin, providing command line > history and editing to the user. In C, I would use GNU readline to do > that. > > Python has the read

Baffled by readline module

2023-03-09 Thread Grant Edwards
In an interactive command-line Python program on Linux, I want to be able to read a line at a time from stdin, providing command line history and editing to the user. In C, I would use GNU readline to do that. Python has the readline module, which appears to be a wrapper for GNU readline. However

Re: unable to resolve readline issues

2022-12-05 Thread Mats Wichmann
stand the use of pyreadline, gnureadline and or just readline. When Python runs interactively, it implicitly tries to import the readline module. On POSIX, Python has a builtin readline module that usually uses the GNU Readline library. On Windows, Python does not include a readline module. In

Re: unable to resolve readline issues

2022-12-04 Thread Sabrina Almodóvar
rform as usual especially trying to understand the >> use of pyreadline, gnureadline and or just readline. > > When Python runs interactively, it implicitly tries to import the > readline module. On POSIX, Python has a builtin readline module that > usually uses the GNU Readline l

Re: unable to resolve readline issues

2022-12-04 Thread MRAB
ion. > Failed calling sys.__interactivehook__ > Traceback (most recent call last): >File "", line 445, in register_readline >File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\readline.py", line 34, in > rl = Rea

Re: unable to resolve readline issues

2022-12-04 Thread Eryk Sun
t; use of pyreadline, gnureadline and or just readline. When Python runs interactively, it implicitly tries to import the readline module. On POSIX, Python has a builtin readline module that usually uses the GNU Readline library. On Windows, Python does not include a readline module. Instead, if stand

unable to resolve readline issues

2022-12-04 Thread biglee12672
uot;", line 445, in register_readline File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\re adline.py", line 34, in rl = Readline() ^^ File "C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py readline

Re: how is the readline set_completer function suppose to work

2019-05-08 Thread Peter Otten
sinbad.sin...@gmail.com wrote: > Below i was expecting the test() function to be called, but it doesn't. Am > i doing it wrong? By the way i'm running version 2.7.10 on a mac. > > $python > >>>> import readline >>>> def test(): > ... pr

how is the readline set_completer function suppose to work

2019-05-08 Thread sinbad . sinbad
Below i was expecting the test() function to be called, but it doesn't. Am i doing it wrong? By the way i'm running version 2.7.10 on a mac. $python >>> import readline >>> def test(): ... print("test") ... >>> test() test >>> pri

GNU Readline and asyncio

2018-07-18 Thread Chris Angelico
Has anyone put together a straight-forward example of using asyncio with readline? For example, suppose you have a command line program that accepts control commands via readline, while accepting socket connections to do its actual work. I can do that in a threaded way fairly easily (spin off a

Re: input vs. readline

2016-07-08 Thread eryk sun
On Sat, Jul 9, 2016 at 12:20 AM, Terry Reedy wrote: > The escape key erasing input back to the beginning of the line is Command > Prompt or cmd.exe behavior. cmd.exe is just a shell that uses the console (if the standard handles are console handles). The console window is hosted by conhost.exe. I

Re: input vs. readline

2016-07-08 Thread eryk sun
On Fri, Jul 8, 2016 at 11:17 PM, John Nagle wrote: > If "readline" is imported, "input" gets "readline" capabilities. > It also loses the ability to import control characters. It doesn't > matter where "readline" is imported; an import in som

Re: input vs. readline

2016-07-08 Thread cs
I was typing in a hurry. There are several unreadable items below. Let me correct myself... On 09Jul2016 09:45, Cameron Simpson wrote: Perhaps the Windows console is treating ESC specially, apparently as "line erase", discarduing any preceeding text. Hence your results. [...] - accept this, a

Re: input vs. readline

2016-07-08 Thread Terry Reedy
On 7/8/2016 7:17 PM, John Nagle wrote: If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can

Re: input vs. readline

2016-07-08 Thread cs
On 08Jul2016 16:17, John Nagle wrote: If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can

input vs. readline

2016-07-08 Thread John Nagle
If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can trigger this. You can try this with a sim

Re: readline and TAB-completion?

2015-11-25 Thread Ulli Horlacher
Peter Otten <__pete...@web.de> wrote: > > Is there a way to make TAB-completion work for other directories, too? > > Remove "/" from the set of delimiters: > > readline.set_completer_delims( > "".join(c for c in readline.get_completer_delims() if c != "/")) Great! > > murksigkeiten > > I

Re: readline and TAB-completion?

2015-11-25 Thread Peter Otten
Ulli Horlacher wrote: > I need an input function with GNU readline support. So far I have: > > import readline > readline.parse_and_bind("tab: complete") > > file = raw_input('File to send: ') > > > Cursor keys are working, but TAB-c

readline and TAB-completion?

2015-11-24 Thread Ulli Horlacher
I need an input function with GNU readline support. So far I have: import readline readline.parse_and_bind("tab: complete") file = raw_input('File to send: ') Cursor keys are working, but TAB-completion works only in the current directory. Example: Fil

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Michael Torrie
t think you can >> really set it a second time and be able to detect it. > > If you input a character stream, that's the case since the characters > are Unicode code points. AFAIK, Unicode doesn't have Ctrl-TAB as a > separate code point. Yes and readline works on char

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Marko Rauhamaa
Skip Montanaro : > It makes perfect sense to me that TAB and Ctrl-TAB would generate the > same keycode, as TAB is itself a control character (Ctrl-I). As the > Ctrl modifier bit is effectively already set, I don't think you can > really set it a second time and be able to detect it. If you input

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-07-09 Thread Skip Montanaro
I thought this thread had died down. I guess not quite... It makes perfect sense to me that TAB and Ctrl-TAB would generate the same keycode, as TAB is itself a control character (Ctrl-I). As the Ctrl modifier bit is effectively already set, I don't think you can really set it a second time and be

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-06-29 Thread Cameron Simpson
On 29Jun2015 11:36, Chris Angelico wrote: On Mon, Jun 29, 2015 at 4:55 AM, Steven D'Aprano wrote: Try Ctrl-TAB again, and you'll get "raise" instead of "import". Can anyone else replicate this issue? Is this a Python issue, a problem with the terminal I am

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-06-28 Thread Chris Angelico
On Mon, Jun 29, 2015 at 4:55 AM, Steven D'Aprano wrote: > Try Ctrl-TAB again, and you'll get "raise" instead of "import". > > Can anyone else replicate this issue? > > Is this a Python issue, a problem with the terminal I am using, or readline >

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-06-28 Thread random832
On Sun, Jun 28, 2015, at 14:55, Steven D'Aprano wrote: > I'm trying to use a readline binding for both TAB and Ctrl-TAB, but it's > not > working for me. Whichever I install second seems to over-ride the first. Can you bind it directly to whatever escape sequence ctrl-tab

Re: Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-06-28 Thread Laura Creighton
I can reproduce this with Python 2.7.9 (default, Mar 1 2015, 12:57:24) on my debian unstable system. On pypy both forms just silently fail to install the binding at all. Since PyPy has its own readline, this is circumstantial evidence that readline is the problem. It's not just you.

Readline -- cannot bind to both Ctrl-tab and tab at the same time?

2015-06-28 Thread Steven D'Aprano
I'm trying to use a readline binding for both TAB and Ctrl-TAB, but it's not working for me. Whichever I install second seems to over-ride the first. In the Python interactive interpreter under Linux, enter these two lines: import readline readline.parse_and_bind('Control-tab: &q

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Skip Montanaro writes: > On Tue, Aug 19, 2014 at 3:44 AM, Lele Gaifax wrote: >> Given these lines in the history: >> >> >>> a=10 >> >>> a-=1 >> >>> print(a) >> 9 > > Suppose you have the above, as you indicated. Ctl-P your way back to > the a=10 line. Press Ctl-O. It executes tha

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Skip Montanaro
On Tue, Aug 19, 2014 at 3:44 AM, Lele Gaifax wrote: >> Does your position in the history disappear if you >> operate_and_get_next(), then modify the next recalled input line? > > Not sure what you mean with "disappear": basically o-a-g-n "accepts" the > current line (that is, "executes" it, and th

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Lele Gaifax writes: > Chris Angelico writes: > >> On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano >> wrote: >> >>> Can you create a feature request for it on the bug tracker, mark me >>> (steven.daprano) as interested, and upload your diff? >> >> And please mark me (rosuav) as interested ("no

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Chris Angelico writes: > On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano > wrote: > >> Can you create a feature request for it on the bug tracker, mark me >> (steven.daprano) as interested, and upload your diff? > > And please mark me (rosuav) as interested ("nosy"), too Sure, will do that AS

Re: Adapt bash readline operate-and-get-next

2014-08-19 Thread Lele Gaifax
Skip Montanaro writes: > Looks reasonable to me, at least if I understand the intent correctly. > I've never used this functionality in bash (wasn't aware it existed). > I assume the intention here is to easily re-execute compound > statements pulled from saved history. Yes, or any arbitrary seq

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Chris Angelico
On Tue, Aug 19, 2014 at 10:17 AM, Steven D'Aprano wrote: > I would love to see support for this in Python. Unfortunately, I'm not > qualified to review your code. Can you create a feature request for it on > the bug tracker, mark me (steven.daprano) as interested, and upload your > diff? If the pa

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Steven D'Aprano
Lele Gaifax wrote: > This is just a first attempt to adapt the Bash code to the Python > readline.c module: I'm very surprised that the half-an-hour I spent on > it, mostly to locate related code, actually full filled the goal :-) You're my hero!!! [...] > Even if I know this is not the right fo

Re: Adapt bash readline operate-and-get-next

2014-08-18 Thread Skip Montanaro
On Mon, Aug 18, 2014 at 1:49 PM, Lele Gaifax wrote: > Even if I know this is not the right forum and I should (and I > eventually do, assuming a positive feedback) instead open a ticket and > attach the patch there, I'd like to hear opinions on whether this should > be enabled by default, and poss

Adapt bash readline operate-and-get-next

2014-08-18 Thread Lele Gaifax
Steven D'Aprano writes: > On Mon, 21 Jul 2014 17:57:22 +0200, Lele Gaifax wrote: >> Granted, the readline library exposes a "operate-and-get-next" function, >> by default bound to \C-o... > > Have you actually got that working in Python with the readline

Re: unable to import rlcompleter readline

2014-03-19 Thread Tim Golden
On 19/03/2014 08:55, muru kessan wrote: > hi guys, > i want the python interactive shell to be auto complete and i found that > by adding the following lines in PYTHONSTARTUP file it is possible > > import rlcompleter, readline > readline.parse_and_bind('tab: comple

unable to import rlcompleter readline

2014-03-19 Thread muru kessan
hi guys, i want the python interactive shell to be auto complete and i found that by adding the following lines in PYTHONSTARTUP file it is possible import rlcompleter, readline readline.parse_and_bind('tab: complete') but i get the following error in git bash shell Note: i run w

Re: Diagnose a segfault in ipython/readline

2014-03-06 Thread Fabio Zadrozny
On Thu, Mar 6, 2014 at 3:11 AM, Felix Yan wrote: > On Wednesday, March 05, 2014 20:15:31 Ned Deily wrote: > > The current > > assumption is that Python 2.7.6+, 3.3.5, and 3.4.0 have no problems with > > readline 6.3. > > Thank you. > > I just gave a try to 3.4

Re: Diagnose a segfault in ipython/readline

2014-03-05 Thread Felix Yan
On Wednesday, March 05, 2014 20:15:31 Ned Deily wrote: > The current > assumption is that Python 2.7.6+, 3.3.5, and 3.4.0 have no problems with > readline 6.3. Thank you. I just gave a try to 3.4.0b2 with readline 6.3, and still get the same segfault. Not sure the version is new enou

Re: Diagnose a segfault in ipython/readline

2014-03-05 Thread Ned Deily
In article <2114014.zHAFJyoHbS@felix-arch>, Felix Yan wrote: > I'm getting a reproducible crash in ipython, but not sure what upstream it > should belong to. > > The crash happens with python 2.7.6/3.3.4, with readline 6.3. > > Steps to reproduce: > > - run

Diagnose a segfault in ipython/readline

2014-03-05 Thread Felix Yan
Hi, I'm getting a reproducible crash in ipython, but not sure what upstream it should belong to. The crash happens with python 2.7.6/3.3.4, with readline 6.3. Steps to reproduce: - run ipython - input some random char sequence that you never inputed (like "ae3r0gka03k0k23"

Re: Building a tree-based readline completer

2013-11-18 Thread roey . katz
> On Mon, 18 Nov 2013 08:55:05 -0800 (PST), roey.k...@gmail.com wrote: > > On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: > > > Thank you. In looking over these classes, I see though that even > them, I would run against the same limitations, though. > Please don't double space your

Re: Building a tree-based readline completer

2013-11-18 Thread Dave Angel
On Mon, 18 Nov 2013 08:55:05 -0800 (PST), roey.k...@gmail.com wrote: On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: > Thank you. In looking over these classes, I see though that even them, I would run against the same limitations, though. Please don't double space your quotes. A

Re: Building a tree-based readline completer

2013-11-18 Thread xDog Walker
On Monday 2013 November 18 09:13, Mark Lawrence wrote: > On 18/11/2013 16:55, roey.k...@gmail.com wrote: > > On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: > >> Thank you. In looking over these classes, I see though that even them, [snip] > Would you please read and action this > ht

Re: Building a tree-based readline completer

2013-11-18 Thread Mark Lawrence
On 18/11/2013 16:55, roey.k...@gmail.com wrote: On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: Thank you. In looking over these classes, I see though that even them, I would run against the same limitations, though. - Roey On Monday, November 18, 2013 11:41:20 AM UTC-5, xDo

Re: Building a tree-based readline completer

2013-11-18 Thread roey . katz
On Monday, November 18, 2013 11:54:43 AM UTC-5, roey wrote: > Thank you. In looking over these classes, I see though that even them, I > would run against the same limitations, though. > > > > - Roey > > > > On Monday, November 18, 2013 11:41:20 AM UTC-5, xDog Walker wrote: > > > On Mo

Re: Building a tree-based readline completer

2013-11-18 Thread roey . katz
Thank you. In looking over these classes, I see though that even them, I would run against the same limitations, though. - Roey On Monday, November 18, 2013 11:41:20 AM UTC-5, xDog Walker wrote: > On Monday 2013 November 18 07:47, roey wrote: > > > I am trying to build a replacement complet

Re: Building a tree-based readline completer

2013-11-18 Thread xDog Walker
On Monday 2013 November 18 07:47, roey.k...@gmail.com wrote: > I am trying to build a replacement completer for python's Cmd class These related packages may be of interest: http://pypi.python.org/pypi/rl http://pypi.python.org/pypi/kmd -- Yonder nor sorghum stenches shut ladle gulls stopper

Building a tree-based readline completer

2013-11-18 Thread roey . katz
nical-tips/software-development/python/python-readline-completions), but so far am up for a loss as to how to get this done. Can anyone help me out here? I've placed a bounty on this with BountySource: https://www.bountysource.com/issues/1319877-implement-a-generalized-completer-functio

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2013-08-21 Thread random832
27;m just > wondering > if this issue has been addressed and if so, what should I be doing that > I'm > not. Do you understand how tty modes (in particular, echo vs non-echo mode) work? What you've got is two different pieces of code (I think running readline in two threads q

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2013-08-21 Thread David M. Welch
ckspace 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

Re: Cannot install readline in pythonbrew install of 3.3.0

2013-04-06 Thread Ned Deily
king okay but when I easy_install readline per > ipython recommend: [...] > Any ideas? pythonbrew does its own funky things above and beyond standard OS X Python installs. Further, the PyPI readline distribution (which substitutes GNU readline for the OS X default BSD editline library) do

Cannot install readline in pythonbrew install of 3.3.0

2013-04-06 Thread Gene
/sbin:/sbin $PYTHONPATH = /Users/Gene/.pythonbrew/pythons/Python-3.3.0/lib The python 3.3.0 install using pythonbrew was made with default options and seems to be working okay but when I easy_install readline per ipython recommend: BTW, readline has been installed for the system python 2.7.3

Pygtk entry readline

2013-02-02 Thread Matthias Fulz
Hi, does anybody know howto connect / use a gtk entry as "frontend" for readline in- / output? I couldn't find anything on the net for my problem. Basicly I've a working readline autocomplete, which I can use without problems via input function, but I want to use that in

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Ned Deily
In article , Peter Otten <__pete...@web.de> wrote: > Ned Deily wrote: > > Keep in mind that the Python readline module may be linked to either the > > GPL-licensed GNU readline or the BSD-licensed editline (libedit) library > > (the default on newer OS X systems and pr

Re: [off topic], was Re: [on topic] Re: readline trick needed

2012-10-16 Thread Dwight Hutto
On Tue, Oct 16, 2012 at 10:36 AM, Peter Otten <__pete...@web.de> wrote: > Dwight Hutto wrote: > > I knew I'd eventually regret putting "on topic" into the subject... I didn't write that. If you're referring to OT, it means Off Topic, and a response would be appreciated. And you can call me David,

[off topic], was Re: [on topic] Re: readline trick needed

2012-10-16 Thread Peter Otten
Dwight Hutto wrote: I knew I'd eventually regret putting "on topic" into the subject... Well done, Dwight. -- http://mail.python.org/mailman/listinfo/python-list

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Dwight Hutto
On Tue, Oct 16, 2012 at 7:27 AM, Steven D'Aprano wrote: > On Tue, 16 Oct 2012 10:30:01 +0200, Peter Otten wrote: > >> Steven D'Aprano wrote: >> >>> I'm working with the readline module, and I'm trying to set a key >>> combination to process

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Steven D'Aprano
On Tue, 16 Oct 2012 13:20:24 +0100, Robert Kern wrote: > On 10/16/12 12:27 PM, Steven D'Aprano wrote: >> Well, I was hoping for a pure Python solution, rather than having to >> troll through who knows how many thousands of lines of code in a >> language I can barely read. > > Are you confusing I

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Robert Kern
On 10/16/12 12:27 PM, Steven D'Aprano wrote: On Tue, 16 Oct 2012 10:30:01 +0200, Peter Otten wrote: Steven D'Aprano wrote: I'm working with the readline module, and I'm trying to set a key combination to process the current command line by calling a known function, *an

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Steven D'Aprano
On Tue, 16 Oct 2012 10:30:01 +0200, Peter Otten wrote: > Steven D'Aprano wrote: > >> I'm working with the readline module, and I'm trying to set a key >> combination to process the current command line by calling a known >> function, *and* enter the command

Re: [on topic] Re: readline trick needed

2012-10-16 Thread Peter Otten
Ned Deily wrote: > In article , Peter Otten <__pete...@web.de> > wrote: >> Steven D'Aprano wrote: >> > I'm working with the readline module, and I'm trying to set a key >> > combination to process the current command line by calling

  1   2   3   4   >