pyobjc

PyObjC giving strange error - [OC_PythonUnicode representations]: unrecognized selector sent to instance 0x258ae2a0

I have this line: NSWorkspace.sharedWorkspace().setIcon_forFile_options_(unicode(icon),unicode(target),0) Why does it give that error and how do I fix it? Thank you. ...

objective C and python - pyobjc

Is it possible for an objective c application to run python files and read their data, ect? If so, can someone post code? or lead me in the right direction? Thanks, Elijah ...

PEXPECT with HOWIE (pyaiml chat bot) to make OBJECTIVE C gui to replace terminal

So I want to make a nice objective c GUI for HOWIE. Can someone show me how to use PEXPECT to communicate with howie? I don't want to use terminal, I want to use my gui as the interface. ...

Python--How do I write the value of a variable into the pasteboard in iPhone (iOS 4)/

I am running iOS 4 on a jailbroken iPhone 3GS. Before I upgraded to iOS 4, I had installed Python on the iPhone and had found the following snippet of Python code to copy a variable (key in this case) to the pasteboard. I then was able to open another application and paste the value into a text field. out = os.popen('\usr\bin\pbcopy',...

Restore Trash Item using ScriptingBridge in Mac OS X via PyObjC

I'm trying to figure out a way to restore (Put Back) Trash Item using ScriptingBridge via PyObjC. There isn't enough documentation here from AppKit import NSURL from ScriptingBridge import SBApplication targetfile = NSURL.fileURLWithPath_(f.realpath) finder = SBApplication.applicationWithBundleIdentifier_("com.apple.Finder") trash_ite...

CoreData can't find mapping model in an OSX framework bundle, but works fine in iOS

I have CoreData-based data layer (using a SQLite datastore) that I am using in both an iOS app and on the server that the iOS clients talk to. The data layer (objc code + coredata model / mapping defns) is compiled into the iOS bundle as per usual, and is compiled into a Framework bundle for use on OSX. I am hitting a brick wall with d...

Problem With openPanelDidEnd in PyObjC in 10.6

The following code which worked fine under OS X 10.5 now fails on 10.6: @IBAction def addButton_(self, sender): panel = NSOpenPanel.openPanel() panel.setCanChooseDirectories_(YES) panel.setAllowsMultipleSelection_(YES) try: panel.beginSheetForDirectory_file_modalForWindow_modalDelegate_didEndSelector_contextI...

Redistribute PyObjC app that depends on third-party library

I've written a PyObjC application that depends on the Python paramiko (ssh) library. Is there a way that I can add the third-party library to my application so that users do not need to sudo easy_install paramiko before running the application? I can see that it is possible to add the python framework to my project, but I don't think t...

How to make NSLog work with Python's logging module when using PyObjC?

I'm writing a Django-based webapp that imports a Cocoa framework via PyObjC. The Cocoa framework has NSLog() littered all through it and while I can see them when running the Django server in non-daemon mode, as soon as I go to daemon I simply lose all this useful NSLog() output. Is there any easy way to get NSLog stuff to bubble up in...

What is PyObjC?

I understand the concept of PyObjC, but can nowhere find any information on what exactly it is or how to get started with it. Is it like a converter, where youinput python files and get an objective c one? Or is it a library you can import to your objective c files which let's you write python in them? Or is it something else entirely?...

How can I write a python script equivalent of mdfind using PyObjC bindings and NSMetadataQuery?

I want to write the python equivalent of mdfind. I want to use the .Spotlight-V100 metadata and I cannot find a description for the metadata db format used, but NSMetadataQuery seems to be what I need. I'd like to do this in python using the built in Obj-C bindings, but have not been able to figure out the correct incantation to get it t...