pyobjc

How do I install GASP for Python 2.6.2 on a Mac

Hey all. I'm currently trying to learn Python and am going through How to Think Like a Computer Scientist: Learning With Python. I have installed Python 2.6.2 on Mac OSX 10.4.11 and am using the IDLE. At the end of chapter 4 Elkner et al. refer to GASP. However their instructions don't work as when I enter: >>> from gasp import* I g...

Pure python gui library?

Hello. Python has a lot of gui librarys: tknter, wxWidgets, pyGTK etc. But all this gui needs to be installed and quite heavyweight, so it's a bit complex to deploy end-user gui python apps that relay on mentioned gui librarys. Recently, i have thinked about python build-in ctypes. Theoretically, it's possible to create pure python gui...

Cocoa Distributed Objects, Long Polling, launchd and "Not Responding" in Activity Monitor

Scenario: I have a Distributed-objects-based IPC between a mac application and a launchd daemon (written with Foundation classes). Since I had issues before regarding asynchronous messaging (e.g. I have a registerClient: on the server's root object and whenever there's an event the server's root object notifies / calls a method in the c...

Reverting a Python/Cocoa project to use the default OSX 10.5 Python (2.5)

Hi, I have installed the latest MacPython (2.6.2) on my Leopard OS X and started an XCode PyObjC project. When I finalized the app, I built the release version and sent it to a friend of mine to try if it runs with out of the box. It did not, because it expects the latest Python, as on my computer. No matter what I tried, I could not...

Error drawing text on NSImage in PyObjC

I'm trying to overlay an image with some text using PyObjC, while striving to answer my question, "Annotate images using tools built into OS X". By referencing CocoaMagic, a RubyObjC replacement for RMagick, I've come up with this: #!/usr/bin/env python from AppKit import * source_image = "/Library/Desktop Pictures/Nature/Aurora.jpg"...

How can you ensure registered atexit function will run with AppHelper.runEventLoop() in PyObjC?

Hi all, I'm just wondering why I my registered an atexit function... e.g. import atexit atexit.register(somefunc) ... AppHelper.runEventLoop() Of course I know when will atexit won't work. When I comment out AppHelper.runEventLoop() the atexit function gets called. I also browsed my pyobjc egg, and I saw under __init__.py under objc ...

Call a selector that takes a char* from PyObjC

I'm trying to use a private framework with PyObjC. I've got this so far: from AppKit import * from Foundation import * import objc framework="/System/Library/PrivateFrameworks/DSObjCWrappers.framework" objc.loadBundle("DSObjCWrapper", globals(), framework) directory = DSoDirectory.alloc() directory.initWithHost_user_password_("server...

Has anyone successfully built a PyObjC app in Snow Leopard?

If you did, would you mind sharing how you did the pyobjc install? I was trying to do it by installing PythonMac 2.5 (for the standalone bundle thru py2app), and doing easy_install of PyObjC. I always get those deprecated errors, primarily those declared in dyld.h, and inside objc_inject.m. I tried compiling from source but still no luc...

Can I write Python applications using PyObjC that target NON-jailbroken iPhones?

Is it currently possible to compile Python and PyObjC for the iPhone such that AppStore applications can written in Python? If not, is this a purely technical issue or a deliberate policy decision by Apple? ...

PyObjc and Cocoa on Snow Leopard

I am about to start my A-Level Computing project (High School Level) which will hopefully be a point-of-sale application for Mac OS. Unfortunately, Objective-C is a little out of my league at the moment and should I get stuck with it in the project I have no one to help out so I would fail the section of the course and not get into Univ...

pyobjc indexed accessor method with range

I'm trying to implement an indexed accessor method for my model class in Python, as per the KVC guide. I want to use the optional ranged method, to load multiple objects at once for performance reasons. The method takes a pointer to a C-array buffer which my method needs to copy the objects into. I've tried something like the following, ...

XCode 3.2 Ruby and Python templates

Under xcode 3.2 my ObjectiveC + Python/Ruby projects can still be opened updated and compiled, but you cannot create new projects. Given that all traces of ruby and python are missing from xcode 3.2 (ie create project and add new ruby/python file), is there an easy way to get the templates installed again? I found some info about copy...

PyObjC development with Xcode 3.2

Xcode 3.2 has removed the default templates for the scripting languages (Ruby, Python etc). How do I find these templates to use in Xcode 3.2? Would I need to add anything else to Xcode to support working with and 'building' PyObjC programs? Additionally, is there any documentation and/or resources that would help me get into PyObjC (an...

How to convert an NSDictionary to a Python dict?

I have a plugin written entirely in Python using PyObjC whose core classes I need to convert to Objective-C. One of them basically just loads up a Python module and executes a specific function, passing it keyword arguments. In PyObjC, this was extremely. However, I'm having difficulty figuring out how to do the same thing using the P...

How to bind a TextField to an IBOutlet()?

I'm trying to figure out how to update an NSTextField programatically. I've figured out how to get the current value of the Text Field from Python: myVar = objc.IBOutlet() .... self.myVar.stringValue() How do I set the value of myVar from the Python side and have the GUI update? I'd like some sort of two way binding (like {myVAR} in...

Writing Cocoa applications in Python 3

It looks like PyObjC is not ported to Python 3 yet. Meanwhile is there a way to write Cocoa applications using Python 3? I am intending to start a new MacOSX GUI application project and though5 would want to use Python 3.x instead of Python 2.x. ...

Basic cocoa application using dock in Python, but not Xcode and all that extras

It seems that if I want to create a very basic Cocoa application with a dock icon and the like, I would have to use Xcode and the GUI builder (w/ PyObjC). The application I am intending to write is largely concerned with algorithms and basic IO - and thus, not mostly related to Apple specific stuff. Basically the application is suppose...

How can I capture iSight frames with Python in Snow Leopard?

I have the following PyObjC script: from Foundation import NSObject import QTKit error = None capture_session = QTKit.QTCaptureSession.alloc().init() print 'capture_session', capture_session device = QTKit.QTCaptureDevice.defaultInputDeviceWithMediaType_(QTKit.QTMediaTypeVideo) print 'device', device, type(device) success = device.open_...

ImportError: No module named Foundation

I am trying to follow the instructions for the accepted answer to "PyObjC development with Xcode 3.2". I will repost them here since I don't have enough rep to comment on the actual question: Here's what I have done to get PyObjC working in Snow Leopard: Using the Finder, I went to Go > Connect to Server... and connected to http://s...

Install PyObjC on Python 2.6 on OS X 10.5?

OS X 10.5.8 came with Python 2.5, and had PyObjC already installed. I installed Python 2.6 from the python.org site, and PyObjC isn't there. I can't find a download to install PyObjC on my Python 2.6 install. Is checking out the PyObjC trunk and trying to build it my only choice? Will that work "out of the box"? ...