Call Python code from an existing project written in Swift

前端 未结 4 984
忘了有多久
忘了有多久 2020-11-27 17:26

I need a way to call Python code from Swift on an Apple platform. A library would be ideal. I\'ve done a considerable amount of Google searching, and the closest material I

4条回答
  •  清歌不尽
    2020-11-27 18:05

    If anyone is ever interested in calling python from swift, here is some helpful material I found:

    • U the python framework - https://developer.apple.com/library/ios/technotes/tn2328/_index.html
    • PyObjC (a little more challenging) -
    • Cobbal - https://github.com/cobbal/python-for-iphone
    • Python docs (you would need to make C-Swift bridge)

    Most of it is for Objective-c, but if you need to use swift you can easily just create an ObjC-Swift bridge (super-super easy) - Lookup the apple docs

提交回复
热议问题