Easy to code Python on Mac?

Discussion in 'Mac Programming' started by Mr West, Sep 4, 2015.

  1. Mr West macrumors member

    Mr West

    Joined:
    Apr 9, 2012
    #1
    I'm looking to buy a MbAir.
    From time to time I code some Python which goes flawless on my current Windows machine.
    So quick question, is it as easy on a Mac or does it require a lot of workarounds?
    It's just basic coding, nothing professional.
     
  2. Baumi macrumors regular

    Joined:
    Mar 31, 2005
    #2
    Most likely, you'll be fine. Python was originally developed for Unix-like platforms, so it's arguably more 'at home' on OS X than on Windows.

    OS X 10.10 comes with Python 2.7 pre-installed. If your scripts are plain standard python (i.e. you're not going out of you way to access DLLs or other Windows-only features), they should run only either as-is or with only minimal changes. (E.g., if your scripts are reading/writing from files, you will probably need to tweak their path names.)

    You can find more information over at python.org. Their text talks about OS X 10.8, but AFAIK the info should be current for 10.10, as well. Also note the version-switcher in the top-left corner of the page, in case you're interested in the docs for a different Python version.
     
  3. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #3
    Can't see it being a problem if you're just doing simple scripts.

    If you want to be fancy/masochistic (depending on personal opinion!), you could even use Xcode. There's a discussion about halfway down this thread: http://forums.macrumors.com/threads/xcode-as-an-ide-for-python.1102146/

    That said, you can get away with a basic text editor if you want.
     
  4. ArtOfWarfare macrumors G3

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #4
    Most Python IDEs are cross platform, I think. I personally just use Sublime Text.
     
  5. Mr West thread starter macrumors member

    Mr West

    Joined:
    Apr 9, 2012
  6. kilon macrumors newbie

    kilon

    Joined:
    Nov 12, 2008
    Location:
    Athens , Greece
    #6
    On macos coding for python is far easier because

    a) Python is already installed in MacOS
    b) Apple unlike Microsoft fully supports Python offering full access to the OS libraries from python as well as documentation of how to do this

    installing XCODE will also give you a very powerful IDE with python support and many more advantages
     
  7. Stella macrumors G3

    Stella

    Joined:
    Apr 21, 2003
    Location:
    Canada
    #7
    Python is vastly easier than on Windows.. for the reason above.

    Pycharm community is a free IDE that you can use. Better than using Xcode or Sublime IMO.
    https://www.jetbrains.com/pycharm/download/

    If your learning Python, your better off using sublime text or other editor - not an IDE - it will add more complexity.
     
  8. jasnw macrumors 6502a

    jasnw

    Joined:
    Nov 15, 2013
    Location:
    Seattle Area (NOT! Microsoft)
    #8
    The only thing to keep an eye on is the python version. At present, El Capitan has the latest python 2 (2.7.10) but I've seen Mac OS lag behind the versions available from places like macports in the past. Also, if you're using python 3 you'll need to get that from elsewhere and install it. If you're just a casual user, however, you're probably using python 2 and will be OK.
     
  9. ArtOfWarfare macrumors G3

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #9
    If you're using 3 you get it from Python.org, no matter what platform.

    Also, I was not aware that El Capitan came with 2.7.10. That's interesting and good.

    So is pip available now on OS X completely out of the box? I'm pretty sure it's bundled with Python as of version 2.7.9 or so...
     
  10. kilon macrumors newbie

    kilon

    Joined:
    Nov 12, 2008
    Location:
    Athens , Greece
    #10
    I think pip was bundled way before that, the only thing that needed installation and probably still does is easy_install

    bare in mind that 2.7 and 3 are diffirent beasts, Apple supports 2.7 because its by far the most popular, python 3 has a new syntax and python 2 apps wont work without modification. So if you want the most support and most libraries go with Apple's python 2.7 but if you want future support for long term projects go with python 3.
     

Share This Page