[Pythonmac-SIG] PyObjC - Apple sample code

Ben Byram-Wigfield ben.bw at me.com
Thu Apr 27 04:17:09 EDT 2017


I tried the repository browser there, and the version of parse_page_contents.py still doesn’t work for me. I’m using the latest downloaded versions of python 2.7 and PyObjC. I also tried using the default OS X versions.
The errors are in the attached file.

Many thanks

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: python_errors.txt
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20170427/46507e85/attachment.txt>
-------------- next part --------------

Ben


> On 27 Apr 2017, at 08:53, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> 
>> 
>> On 22 Apr 2017, at 10:45, Ben Byram-Wigfield <ben.bw at me.com> wrote:
>> 
>> I’ve been looking at Apple’s Open Source website, where there is lots of python sample code. But the examples I’ve tried don’t work. They all flag syntax errors (usually about type conversion), or occasionally make the python process crash!
>> 
>> Particularly, I’m looking at a script to parse the contents of a PDF file. There are a few slightly different versions (and I don’t understand all the different folders — pyobj 14, 26, 47, 49???)
>> 
>> https://opensource.apple.com/source/pyobjc/pyobjc-49/pyobjc/pyobjc-framework-Quartz-2.5.1/Examples/Programming%20with%20Quartz/ParsePageContents/parse_page_contents.py
>> 
>> https://opensource.apple.com/source/pyobjc/pyobjc-14.1.1/pyobjc/stable/pyobjc-framework-Quartz/Examples/Programming%20with%20Quartz/ParsePageContents/parse_page_contents.py
>> 
>> But none of them work. I’ve tried them on PyObjc 2.5.1 and 3.2.1, which gives different syntax errors. (Question 2, why does OS X ship with only 2.5.1?)
>> 
>> I’ve scoured the internet for better examples of python-quartz-pdf_parsing, but not found anything. The Apple Dev Forums suggested that the code wasn’t maintained by Apple, but by PyObjC.
> 
> See http://pyobjc.sf.net/, which contains all current examples and those should work with the current release of PyObjC and python 2.7 and 3.x.
> 
> Ronald



More information about the Pythonmac-SIG mailing list