Is that possible to run a python built program on iOS as a static lib?

家住魔仙堡 提交于 2020-02-01 04:23:53

问题


I have some AI code developed in python 2.7 that uses non-standard libraries.

I intend to compile it to work with my iPhone app.

I wouldn't like to re-program everything so, is that a way to compile my python code + all dependencies into a static file so I can call it from my iOS app as a function?


回答1:


kivy can do it

http://kivy.org/docs/guide/packaging-ios.html

also maybe look at https://itunes.apple.com/us/app/python-for-ios/id485729872?ls=1&mt=8

although I doubt you can just compile your existing project into it... you will need to re-write at least part of it and you can only use pure python libraries (kivy)




回答2:


iPhone apps must be Objective-C, C, C++ or Objective-C++. They cannot interpret Python code.

However, if you have access to the library source, you may be able to translate and then compile the Python source to C code.

I would look into the PyPy Toolchain as a starting point.



来源:https://stackoverflow.com/questions/18879490/is-that-possible-to-run-a-python-built-program-on-ios-as-a-static-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!