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.

1 Answer 1

7

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.