Re: [Pythonmac-SIG] readline support for OS X Leopard
On Oct 26, 2007, at 7:50 PM, [EMAIL PROTECTED] wrote: It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind (bind ^I rl_complete) Edward's example of using EditLine syntax works for my raw python test: $ python import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) readline.[TAB KEY PRESSED] readline.__class__ readline.__class__ readline.__class__ readline.__delattr__ readline.__delattr__ readline.__dict__ ... BUT If I change the IPython config file to use EditLine syntax, I get a segmentation fault when I start ipython. $ diff .ipython/ipythonrc.0 .ipython/ipythonrc 395c395 readline_parse_and_bind tab: complete --- readline_parse_and_bind bind ^I complete $ ipython Segmentation fault Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x6a000c6c Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0x91f22620 strcmp + 80 1 libedit.2.dylib 0x0044a906 map_bind + 1345 2 libedit.2.dylib 0x0044abec el_parse + 236 3 libedit.2.dylib 0x00457372 rl_parse_and_bind + 85 4 readline.so 0x00440e6a 0x44 + 3690 5 org.python.python 0x0018d826 PyEval_EvalFrameEx + 17116 6 org.python.python 0x0018da08 PyEval_EvalFrameEx + 17598 7 org.python.python 0x0018da08 PyEval_EvalFrameEx + 17598 8 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 9 org.python.python 0x0018daa5 PyEval_EvalFrameEx + 17755 10 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 11 org.python.python 0x00139c47 PyFunction_SetClosure + 2646 12 org.python.python 0x0011fd5d PyObject_Call + 50 13 org.python.python 0x00128618 PyMethod_New + 2457 14 org.python.python 0x0011fd5d PyObject_Call + 50 15 org.python.python 0x00188b35 PyEval_CallObjectWithKeywords + 211 16 org.python.python 0x0012484d PyInstance_New + 305 17 org.python.python 0x0011fd5d PyObject_Call + 50 18 org.python.python 0x0018db3a PyEval_EvalFrameEx + 17904 19 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 20 org.python.python 0x0018daa5 PyEval_EvalFrameEx + 17755 21 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 22 org.python.python 0x0018f568 PyEval_EvalCode + 87 23 org.python.python 0x001a6a0c PyErr_Display + 1896 24 org.python.python 0x001a7036 PyRun_FileExFlags + 135 25 org.python.python 0x001a89a2 PyRun_SimpleFileExFlags + 421 26 org.python.python 0x001b3c23 Py_Main + 3095 27 org.python.pythonapp0x1fca 0x1000 + 4042 ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Robert Kern wrote: Boyd Waters wrote: On Oct 26, 2007, at 7:50 PM, [EMAIL PROTECTED] wrote: It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind (bind ^I rl_complete) Edward's example of using EditLine syntax works for my raw python test: $ python import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) readline.[TAB KEY PRESSED] readline.__class__ readline.__class__ readline.__class__ readline.__delattr__ readline.__delattr__ readline.__dict__ ... Try typing b. Sorry, I misread your post. I meant that trying that with a readline module compiled against GNU readline interferes with typing b. So, unfortunately, you can't just issue both commands hoping that the library will just ignore the wrong one. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this unit test of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind(tab: complete) Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. TAB PRESSED The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from raw interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
I was just going to say the same thing. Getting this to work and then GVim, and I will be quite happy. On 10/26/07, Boyd Waters [EMAIL PROTECTED] wrote: Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this unit test of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind(tab: complete) Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. TAB PRESSED The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from raw interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind (bind ^I rl_complete) Ed On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: I was just going to say the same thing. Getting this to work and then GVim, and I will be quite happy. On 10/26/07, Boyd Waters [EMAIL PROTECTED] wrote: Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this unit test of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind(tab: complete) Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. TAB PRESSED The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from raw interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind (bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
The rlineimpl.py module is the place in python where readline gets imported. I would look there and also I would look to see where ipython is doing its equivalent of parse_and_bind. Brian On 10/26/07, Noah Gift [EMAIL PROTECTED] wrote: Ed, You are a genius! Thanks, I totally forgot you told me that. So for the record when you launch IPython: import readline readline.parse_and_bind (bind ^I rl_complete) Then do something like: import os and you will get In [5]: os. Display all 234 possibilities? (y or n) Ok, what is the easiest way to get IPython to automatically do this? This would be great to document. Also, (shamelessly off-topic), if anyone has GVim working...let me know, cough, it is for Python and it is on Mac :) On 10/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind (bind ^I rl_complete) Ed On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: I was just going to say the same thing. Getting this to work and then GVim, and I will be quite happy. On 10/26/07, Boyd Waters [EMAIL PROTECTED] wrote: Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this unit test of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind(tab: complete) Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. TAB PRESSED The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from raw interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter
Re: [Pythonmac-SIG] readline support for OS X Leopard
Ed, You are a genius! Thanks, I totally forgot you told me that. So for the record when you launch IPython: import readline readline.parse_and_bind (bind ^I rl_complete) Then do something like: import os and you will get In [5]: os. Display all 234 possibilities? (y or n) Ok, what is the easiest way to get IPython to automatically do this? This would be great to document. Also, (shamelessly off-topic), if anyone has GVim working...let me know, cough, it is for Python and it is on Mac :) On 10/26/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind (bind ^I rl_complete) Ed On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: I was just going to say the same thing. Getting this to work and then GVim, and I will be quite happy. On 10/26/07, Boyd Waters [EMAIL PROTECTED] wrote: Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this unit test of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind(tab: complete) Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. TAB PRESSED The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from raw interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs:
[Pythonmac-SIG] readline support for OS X Leopard
I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Noah ... if someone has any easy fix to get readline to work, I would Noah greatly appreciate it. Just install GNU readline and point the build system at it. For example, I have MacPorts (http://www.macports.org/) installed in /opt/local. GNU readline is installed there, and my readline module is linked against that: % otool -L ~/local/lib/python2.6/lib-dynload/readline.so /Users/skip/local/lib/python2.6/lib-dynload/readline.so: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncursesw.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 93.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.10) Configured like so: ./configure --prefix=/Users/skip/local CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib I don't do framework builds, but if CPPFLAGS and LDFLAGS are set appropriately those should work as well. Skip ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind(bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind(bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
We did fix a few bugs related to IPython and Leopard's python, so to some degree, it does work (sorry, I don't use IPython myself). There was a problem with IPython explicitly loading ~/.inputrc when readline support is available, which will fail due to the command syntax problem. Just guessing, but converting the .inputrc to EditLine syntax *should* probably fix that problem. Ed On Oct 22, 2007, at 11:35 AM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Interesting. FWIW I just built IPython against the system python (with libedit, apparently) and it works fine; I have readline-like command navigation, history support, etc. I was not aware of any change from using readline (which is what I used with 10.4.x) On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
I am forwarding this to the ipython-dev list. A number of the core ipython dev's use OS X, so we will surely jump on this one as soon as we get our hands on Leopard. This (libedit support) is great news as it has been one of the main problems with the built-in Python on OS X for a long time. Cheers, Brian On 10/22/07, Noah Gift [EMAIL PROTECTED] wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] readline support for OS X Leopard
Brian, Thanks, I was just considering doing this myself. I would be happy to help document this if there is a suitable wiki for it, once a clear path gets figured out. If you do google searches for readline os x, or ipython, etc, you will tons, of people who have had this problem for quite some time. Getting clear documentation for OS X users will help the IPython cause greatly. I know in the book Jeremy Jones and I are writing, we covering IPython quite a bit, as we think it is the preferred tool for sysadmins to write code in. This is slightly off topic, but the doctest inclusion is the icing on the cake as far as I am concerned with IPython. Noah On 10/22/07, Brian Granger [EMAIL PROTECTED] wrote: I am forwarding this to the ipython-dev list. A number of the core ipython dev's use OS X, so we will surely jump on this one as soon as we get our hands on Leopard. This (libedit support) is great news as it has been one of the main problems with the built-in Python on OS X for a long time. Cheers, Brian On 10/22/07, Noah Gift [EMAIL PROTECTED] wrote: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy [EMAIL PROTECTED] wrote: On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind (bind ^I rl_complete) For vi mode, one needs: readline.parse_and_bind(bind -v) -- Edward Moy Apple Computer, Inc. [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig