Python shell on mac os x

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bert Heymans

    #1

    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

  • Greg Donald

    #2
    Re: Python shell on mac os x

    On 15 Mar 2007 14:56:13 -0700, Bert Heymans <bert.heymans@g mail.comwrote:
    >^[OA^[OC^[OD
    Is your python built with readline support?

    Also, you might check out iPython.


    --
    Greg Donald

    Comment

    • Alex Martelli

      #3
      Re: Python shell on mac os x

      Bert Heymans <bert.heymans@g mail.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

      Comment

      • martin.laloux@gmail.com

        #4
        Re: Python shell on mac os x

        or go to

        and you have python 2.5 or python 2.4.4 with readline support

        Comment

        • Bert Heymans

          #5
          Re: Python shell on mac os x

          On Mar 16, 4:08 am, a...@mac.com (Alex Martelli) wrote:
          Bert Heymans <bert.heym...@g mail.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

          Comment

          • 7stud

            #6
            Re: Python shell on mac os x

            On Mar 16, 2:53 am, martin.lal...@g mail.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?

            Comment

            • Kevin Walzer

              #7
              Re: Python shell on mac os x

              7stud wrote:
              On Mar 16, 2:53 am, martin.lal...@g mail.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

              Comment

              • Lou Pecora

                #8
                Re: Python shell on mac os x

                In article <45FC20E0.30809 07@codebykevin. com>,
                Kevin Walzer <kw@codebykevin .comwrote:
                7stud wrote:
                On Mar 16, 2:53 am, martin.lal...@g mail.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.

                Comment

                Working...