pyobjc

PyList_GetItem() returning a reference

PyList_GetItem() returning a reference Question: I am using the PyHelper class that I found HERE My python script is returning a list and in C++ I can call PyList_Size() and successfully get the size but when I try get item it returns a very large number which I assume is a address reference rather than …

Total answers: 1

PyObjC: Accessing MPNowPlayingInfoCenter

PyObjC: Accessing MPNowPlayingInfoCenter Question: I am creating a MacOS media player in Python (version 3.10) and want to connect it to the MacOS "Now Playing" status. I have worked with PyObjC a bit in order to listen for media key events, but have not been able to connect to the MPNowPlayingInfoCenter interface. According to the …

Total answers: 2

How to solve pyobjc installation problem?

How to solve pyobjc installation problem? Question: pip install pyobjc-framework-Quartz Defaulting to user installation because normal site-packages is not writeable Collecting pyobjc-framework-Quartz Using cached pyobjc-framework-Quartz-6.2.2.tar.gz (3.4 MB) ERROR: Command errored out with exit status 1: command: ‘c:program filespython38python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’C:\Users\Charan\AppData\Local\Temp\pip-install-qnwuu7s1\pyobjc-framework-Quartz\setup.py’"’"’; __file__=’"’"’C:\Users\Charan\AppData\Local\Temp\pip-install-qnwuu7s1\pyobjc-framework-Quartz\setup.py’"’"’;f=getattr(tokenize, ‘"’"’open’"’"’, open)(__file__);code=f.read().replace(‘"’"’rn’"’"’, ‘"’"’n’"’"’);f.close();exec(compile(code, __file__, ‘"’"’exec’"’"’))’ egg_info –egg-base ‘C:UsersCharanAppDataLocalTemppip-pip-egg-info-v7jcwbrn’ …

Total answers: 2

OS X: Move window from Python

OS X: Move window from Python Question: I’m trying to move around windows programatically from Python on OS X. I found a snippet of AppleScript here on Stackoverflow which does this, but I’d like to do it in Python or another “real” scripting language. This is my Python script, which does not work. I wrote …

Total answers: 3

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

How to put a tkinter window on top of the others? Question: 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 …

Total answers: 9

Create (sane/safe) filename from any (unsafe) string

Create (sane/safe) filename from any (unsafe) string Question: I want to create a sane/safe filename (i.e. somewhat readable, no "strange" characters, etc.) from some random Unicode string (which might contain just anything). (It doesn’t matter for me whether the function is Cocoa, ObjC, Python, etc.) Of course, there might be infinite many characters which might …

Total answers: 13

ImportError: No module named Foundation

ImportError: No module named Foundation Question: 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, …

Total answers: 10

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

Can I write Python applications using PyObjC that target NON-jailbroken iPhones? Question: 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? Asked By: brotchie || Source Answers: no, apple …

Total answers: 4