[Pythonmac-SIG] PyObjC - Apple sample code

Ben Byram-Wigfield ben.bw at me.com
Sat Apr 22 04:45:19 EDT 2017


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-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 <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.

Thanks for any help.

Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20170422/cfac3a72/attachment.html>


More information about the Pythonmac-SIG mailing list