Run a python script (a .py file) using swift /Objective-C within Xcode(for iOS app).

I am looking for a way to run the .py (python file) inside the iOS application, but I am unable to find a way for iOS apps. but for MAC I see PythonKit support.

Appreciate any help.

There are two sides to this:

  • Technical

  • Business

On the business side, I see you’ve started a separate thread for that and I’ll reply over there.

On the technical side, there’s nothing to fundamentally prevent you from embedding the Python runtime in your app and using it to run Python code. There are apps out there that do it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo Thanks for replying. I am looking from the Technical side. I am trying to run ** py file** stored locally/internally in iOS app. let's take I have py file path how do I use here let myEmail = "eskimo" + "1" + "@" + "apple.com" ? Appreciate if you could document or link.

I am looking from the Technical side. I am trying to run .py file stored locally/internally in iOS app.

To do that you’ll need to embed a copy of the Python runtime. I don’t have any specific advice on that front. My primary focus is on Apple stuff. I can only help with third-party stuff when I have direct experience with it, and that’s not the case here.

If no one else chimes in I recommend that you pursue this via a Python-specific resources. You’re not the first person who’s wanted to do this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Run a python script (a .py file) using swift /Objective-C within Xcode(for iOS app).
 
 
Q