Python shell on mac os x

Discussion in 'Python' started by Bert Heymans, Mar 15, 2007.

  1. Bert Heymans

    Bert Heymans Guest

    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
    Bert Heymans, Mar 15, 2007
    #1
    1. Advertising

  2. Bert Heymans

    Greg Donald Guest

    On 15 Mar 2007 14:56:13 -0700, Bert Heymans <> wrote:
    > >>> ^[OA^[OC^[OD


    Is your python built with readline support?

    Also, you might check out iPython.


    --
    Greg Donald
    http://destiney.com/
    Greg Donald, Mar 15, 2007
    #2
    1. Advertising

  3. Bert Heymans <> wrote:

    > 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
    Alex Martelli, Mar 16, 2007
    #3
  4. Bert Heymans

    Guest

    , Mar 16, 2007
    #4
  5. Bert Heymans

    Bert Heymans Guest

    On Mar 16, 4:08 am, (Alex Martelli) wrote:
    > Bert Heymans <> wrote:
    > > 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
    Bert Heymans, Mar 16, 2007
    #5
  6. Bert Heymans

    7stud Guest

    On Mar 16, 2:53 am, 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?
    7stud, Mar 16, 2007
    #6
  7. Bert Heymans

    Kevin Walzer Guest

    7stud wrote:
    > On Mar 16, 2:53 am, 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
    Kevin Walzer, Mar 17, 2007
    #7
  8. Bert Heymans

    Lou Pecora Guest

    In article <>,
    Kevin Walzer <> wrote:

    > 7stud wrote:
    > > On Mar 16, 2:53 am, 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.
    Lou Pecora, Mar 19, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Heimes
    Replies:
    0
    Views:
    585
    Christian Heimes
    Feb 27, 2008
  2. Gerardo Herzig
    Replies:
    1
    Views:
    1,059
    Philipp Pagel
    Feb 27, 2008
  3. D'Arcy J.M. Cain
    Replies:
    0
    Views:
    845
    D'Arcy J.M. Cain
    Feb 27, 2008
  4. edwithad

    Bash shell to Python shell?

    edwithad, Sep 28, 2009, in forum: Python
    Replies:
    4
    Views:
    1,717
  5. K Richard Pixley
    Replies:
    3
    Views:
    332
    Ned Deily
    Jan 3, 2012
Loading...

Share This Page