Running python code from standard Cocoa application
Asked Answered
K

1

8

I have an XCode project built as a Cocoa single document application (it's not a Python-Cocoa application, that is not what I want).

All the documentation I found assumes I want to create a Cocoa application with code written in Python and this is not the case - I want a standard Cocoa application that calls a method out of a Python class.

Can I use PyObjC to run python code from a file without replacing the Cocoa standard main.c with a main.py file?

Later edit: I am aware of Python.framework but as far as I can tell I can only send parameters to PyRun_SimpleFile through the environment - I'd like to use the bridge directly to exchange data with the python code.

Kline answered 21/4, 2009 at 11:18 Comment(0)
I
7

A google search for embed python objective C, returns a few links that might be of interest, in particular:

Iorgo answered 21/4, 2009 at 11:57 Comment(1)
I've looked at the first link a couple of days ago, but I was to blind to see it did indeed describe the solution to my problem. Thanks.Kline

© 2022 - 2024 — McMap. All rights reserved.