I was wondering if anyone can explain why all of a sudden in Python interactive mode all arrow keys are failing?
When I press up button for example to go through command history I get “^[[A”. Same with any other arrow keys.
I have no idea why this happened and it was working before (on OS X Snow Leopard). Does anyone know a way to fix this?
Many thanks,
G
You don’t say which Python you are using but the symptoms you mention are indeed usually caused by Python not being built with
readlinesupport. These days Python on OS X can be built to use either the GNUreadlinelibrary or the Apple-suppliededitlinelibrary (AKAlibedit). You can use the following two commands to show exactly which Python you are using. If that does not help you figure out what is going on, edit your question to show the output from those commands.Here’s an example that shows a recent MacPorts Python 2.6 on OS X 10.6:
The path prefix
/opt/local/is the default location for MacPorts-installed software and the output fromotoolindicates that this Python’sreadlinemodule is dynamically linked to the MacPorts-installed GNUreadlinelibrary.