pyobjc

How do you listen to notifications from iTunes on a Mac (Using the NSDistributedNotificationCenter)

主宰稳场 提交于 2019-11-27 06:20:59
问题 Looking for help/tutorials/sample code of using python to listen to distributed notifications from applications on a mac. I know the py-objc lib is the bridge between python and mac/cocoa classes, and the Foundation library can be used to add observers, but looking for examples or tutorials on how to use this to monitor iTunes. 回答1: If anyone comes by to this question, i figured out how to listen, the code below works. However accessing attributes do not seem to work like standard python

py2app is not copying the Python.framework to the new app while using virutalenv

混江龙づ霸主 提交于 2019-11-27 06:07:19
问题 environment: MacOS X 10.7.2, system installed python 2.7.1, virtualenv 1.7.2, pyobjc 2.3, py2app 0.6.4+ I have a newly created virtualenv with pyobc 2.3 and py2app installed. When I run python setup.py py2app to create an app (for example in py2app/examples/simple) everything seems to compile and it does produce a double clickable app, but after clicking on that app I get the following error: A Python runtime not could be located. You may need to install a framework build of Python, or edit

ImportError: No module named Foundation

时间秒杀一切 提交于 2019-11-27 01:33:41
问题 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://svn.red-bean.com/pyobjc/trunk/pyobjc/pyobjc-xcode/ as a guest. I then made a folder called Xcode on my local system at ~Library/Application Support/Developer/Shared

PyObjC on Xcode 4

℡╲_俬逩灬. 提交于 2019-11-27 01:23:13
问题 Xcode 3 had templates for building Cocoa subclasses in Python. I've recently upgraded to Xcode 4 but I cannot find out how I can use other languages besides the C family (C, C++, Obj-C) in Xcode 4. Does anyone know? 回答1: The Python-Cocoa class templates you're looking for are part of PyObjC, but Apple stopped including them in the install around the end of Leopard (I think), because they got out of sync with Xcode. You can download the latest versions yourself from the PyObjC repository.

How to put a tkinter window on top of the others?

家住魔仙堡 提交于 2019-11-26 18:13:33
问题 I'm using Python 2 with Tkinter and PyObjC , and then I'm using py2app . The program is working fine, but the window starts as hidden whenever I open the program, so it doesn't appear until I click on the icon on the dock to bring it up. Is there any way to control this, make the window to be on top of other windows that were open when the application is starting? Just to clarify, it doesn't have to be on the top for the whole time the application is running. I just need it to be on top of