473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Python shell on mac os x

Hi!

I'm using iTerm on the mac the keymapping isn't right. On Linux and
Windows it's really nice to be able to hit up to get the previous
command. Does anyone know a way to get the Pyhton shell to work like
on other systems, I always get this when I hit the direction keys:
>>^[OA^[OC^[OD
I've been looking for the correct mappings but can't find a proper
reference online nor what the Python shell expects. Any help would be
greatly appreciated! Hints/suggestions on keywords to use in a search
on Google are always welcome :) I don't know where to begin looking
for this kind of information.

kind regards,

- Bert Heymans

Mar 15 '07 #1
7 4005
On 15 Mar 2007 14:56:13 -0700, Bert Heymans <be**********@gmail.comwrote:
>^[OA^[OC^[OD
Is your python built with readline support?

Also, you might check out iPython.
--
Greg Donald
http://destiney.com/
Mar 15 '07 #2
Bert Heymans <be**********@gmail.comwrote:
Hi!

I'm using iTerm on the mac the keymapping isn't right. On Linux and
Windows it's really nice to be able to hit up to get the previous
command. Does anyone know a way to get the Pyhton shell to work like
on other systems, I always get this when I hit the direction keys:
>^[OA^[OC^[OD

I've been looking for the correct mappings but can't find a proper
reference online nor what the Python shell expects. Any help would be
greatly appreciated! Hints/suggestions on keywords to use in a search
on Google are always welcome :) I don't know where to begin looking
for this kind of information.
The Python 2.3.5 bundled with MacOSX doesn't come with readline.
Download 2.5 (or if you must 2.4) for the Mac from www.python.org and
live happily ever after.

E.g. (I'm hitting an up-arrow the 2nd time, then control-D next time):

brain:~ alex$ python2.3
Python 2.3.5 (#1, Jan 13 2006, 20:13:11)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>2+2
4
>>^[[A
File "<stdin>", line 1
^
SyntaxError: invalid syntax
>>^D
brain:~ alex$ python2.4
Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>2+2
4
>>2+2
4
>>>
brain:~ alex$
Alex
Mar 16 '07 #3
or go to
http://pythonmac.org/packages/
and you have python 2.5 or python 2.4.4 with readline support

Mar 16 '07 #4
On Mar 16, 4:08 am, a...@mac.com (Alex Martelli) wrote:
Bert Heymans <bert.heym...@gmail.comwrote:
Hi!
I'm using iTerm on the mac the keymapping isn't right. On Linux and
Windows it's really nice to be able to hit up to get the previous
command. Does anyone know a way to get the Pyhton shell to work like
on other systems, I always get this when I hit the direction keys:
>>^[OA^[OC^[OD
I've been looking for the correct mappings but can't find a proper
reference online nor what the Python shell expects. Any help would be
greatly appreciated! Hints/suggestions on keywords to use in a search
on Google are always welcome :) I don't know where to begin looking
for this kind of information.

The Python 2.3.5 bundled with MacOSX doesn't come with readline.
Download 2.5 (or if you must 2.4) for the Mac fromwww.python.organd
live happily ever after.

E.g. (I'm hitting an up-arrow the 2nd time, then control-D next time):

brain:~ alex$ python2.3
Python 2.3.5 (#1, Jan 13 2006, 20:13:11)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>2+2
4
>^[[A

File "<stdin>", line 1
^
SyntaxError: invalid syntax>>^D

brain:~ alex$ python2.4
Python 2.4.3 (#1, Apr 7 2006, 10:54:33)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>2+2
4
>2+2
4

brain:~ alex$

Alex
Wow, thanks for pointing that out Alex! I wasn't even hoping a
solution could be that simple :s

Mar 16 '07 #5
On Mar 16, 2:53 am, martin.lal...@gmail.com wrote:
or go tohttp://pythonmac.org/packages/
and you have python 2.5 or python 2.4.4 with readline support
The download instructions seem to steer Mac users to version 2.4.4
because it has more modules available. What is the consensus on that?

Mar 16 '07 #6
7stud wrote:
On Mar 16, 2:53 am, martin.lal...@gmail.com wrote:
>or go tohttp://pythonmac.org/packages/
and you have python 2.5 or python 2.4.4 with readline support

The download instructions seem to steer Mac users to version 2.4.4
because it has more modules available. What is the consensus on that?
If you just want binary packages installed, it might make sense to use
2.4.4, but building new packages with 2.5 is easy: either use
easy_install or sudo python setup.py. I've had no trouble building the
stuff I need with 2.5.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Mar 17 '07 #7
In article <45**************@codebykevin.com>,
Kevin Walzer <kw@codebykevin.comwrote:
7stud wrote:
On Mar 16, 2:53 am, martin.lal...@gmail.com wrote:
or go tohttp://pythonmac.org/packages/
and you have python 2.5 or python 2.4.4 with readline support
The download instructions seem to steer Mac users to version 2.4.4
because it has more modules available. What is the consensus on that?

If you just want binary packages installed, it might make sense to use
2.4.4, but building new packages with 2.5 is easy: either use
easy_install or sudo python setup.py. I've had no trouble building the
stuff I need with 2.5.
And what is the stuff you need? So we can see what definitely works.
Thanks.

-- Lou Pecora (my views are my own) REMOVE THIS to email me.
Mar 19 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Logan | last post by:
Several people asked me for the following HOWTO, so I decided to post it here (though it is still very 'alpha' and might contain many (?) mistakes; didn't test what I wrote, but wrote it - more or...
20
by: Matthew Thorley | last post by:
My friend sent me an email asking this: > I'm attemtping to decide which scripting language I should master and > was wondering if it's possible to do > these unixy awkish commands in python:...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
3
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.