is PyObjC still in use?

Discussion in 'Mac Programming' started by Chirone, Aug 9, 2011.

  1. Chirone macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    Just thought I'd make an app where you can control stuff with apple scripting when I came across the idea of PyObjC, but going to pyobjc.sourceforge.net shows it hasn't been updated since late 2009.

    Does anyone know if pyobjc is still a valid thing to use?

    also, does anyone know if you can write the core of your application in objc and c/c++ and then use apple script obj c to build the interface for it?
     
  2. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #2
    Not if you want to use Python 3.

    Yes, on Apple systems there is something called Objective-C++.

    http://en.wikipedia.org/wiki/Objective-C#Objective-C.2B.2B
     
  3. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #3
    Yes, Python-ObjC still works very well. I use it in a number of my scripts to work with Plists, and to call ObjC methods.

    Apple has shipped Python-ObjC bindings in their OSs for quite some time now, so nothing more is needed for at least 10.5+. The bindings for Python and Ruby are well maintained, while the Perl ones seem to be lagging. It should also be noted that MacRuby ships standard with Lion as well (very exciting direction there... even though I am not a ruby programmer).

    Note that if you want templates to create Python-ObjC, Ruby-ObjC, or Perl-ObjC applications you are going to have to dig them up from the open-source projects, as Apple has discontinued those templates in XCode. I have not tried on XCode 4, but in later versions of XCode 3 you could still drop the template files into place and they would just work.

    I don't know why you bring up Python 3. Lion does not include Python 3, and there are no Python-ObjC bindings for Python 3 that I am aware of from anywhere.

    Technically this is probably possible, but this would be an astoundingly bad decision to go that way. The methods to bind ObjC through XCode are a pure pleasure to use. Everything else is work.
     
  4. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
  5. Chirone thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #5
    MorphingDragon: noted, thanks

    larkost: thanks, that's good to know.

    I shall explore python-objc now
     
  6. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #6
    Actually... I think you'll be pleasantly surprised regarding Lion and Python 3. Typing:
    Code:
    python3
    ... at a Terminal prompt gives me the good old Python 3.2.1 console, at least in Lion. This did not work in Snow Leopard... oh, and Python 2.7.1 is installed in Lion too (but not Python 2.7.2, which arrived too late for Apple to include).

    I did install Python 3.2.1 from python.org at the time I tested, but did not elect to update the shell profile... which to me suggests that there is indeed Python 3 support in Lion. I may be wrong, though.
     
  7. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #7
    Yes, you are wrong .
     
  8. AlmostThere macrumors 6502a

    #8
    PyPI seems to list them for 3.1 and 3.2, although I haven't tested first hand (still on 2.x)
    http://pypi.python.org/pypi/pyobjc-core/2.3

    Long list of all python packages
    http://pypi.python.org/pypi?:action=index
    and then Cmd-F to find "pyobj" links to all the frameworks with bindings (nt that well organised AFAICT)

    I tend to use MacPorts Python and these packages worked with that last time I used them (~6 months ago)

    I found installing the PyPI versions with the default Python or python.org versions difficult to impossible.
     

Share This Page