从用 Swift 编写的现有项目中调用 Python 代码 [英] Call Python code from an existing project written in Swift

查看:124
本文介绍了从用 Swift 编写的现有项目中调用 Python 代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种在 Apple 平台上从 Swift 调用 Python 代码的方法.图书馆将是理想的选择.我已经做了大量的谷歌搜索,我找到的最接近的材料是 Objective-C.

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 found is for Objective-C.

推荐答案

如果有人对从 swift 调用 python 感兴趣,这里是我找到的一些有用的材料:

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

大部分是针对Objective-c的,但如果你需要使用swift,你可以轻松地创建一个ObjC-Swift桥(超级超级简单)-查找苹果文档

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

这篇关于从用 Swift 编写的现有项目中调用 Python 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆