4

I want to make a native iOS app. It will be written mostly in Objective-C. But I need to invoke some python scripts. I have been researching on this for hours.

Questions:

1: I found this post(Running python/ruby script on iPhone? From the iPhone OS 4 Terms --- 3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)). But it has been 2 year. Is there any changes to this agreement?

2: If it is possible to invoke a python script in an iOS app, can someone explain it to me with some code samples?

Community
  • 1
  • 1
Peter Zhou
  • 3,881
  • 2
  • 21
  • 19
  • 1
    It's probably going to be pretty complicated and kludgy. If the scripts are small enough you might be able to just rewrite them in Objective-C. – Nathan Villaescusa Oct 05 '12 at 17:59
  • @NathanVillaescusa Thank you Nathan. The script is not complicated and I think I can rewrite it in Objective-C. But I really want to know how to run python scripts in an iOS app. – Peter Zhou Oct 05 '12 at 18:06
  • 1
    read this, may be this one you looking for http://stackoverflow.com/questions/8862085/running-python-script-from-cocoa-application-using-gcd – subhash kumar singh Oct 05 '12 at 18:47
  • @subh.singh I know we can run python on a Mac. Thanks anyway. – Peter Zhou Oct 05 '12 at 19:17
  • The answer is basically a link for [this](https://stackoverflow.com/questions/3691655/embedding-python-in-an-iphone-app) question, so I propose to close this as a duplicate. – kelin Aug 25 '22 at 13:48

1 Answers1

5

You will need to embed an interpreter into your app. I believe this is the thread you are looking for. Embedding Python in an iPhone app

Community
  • 1
  • 1
Matt
  • 1,586
  • 8
  • 12