什么是 PyObjC?

发布于 2024-09-28 00:45:21 字数 228 浏览 0 评论 0原文

我理解 PyObjC 的概念,但无法找到有关它到底是什么或如何开始使用它的任何信息。

它是否像一个转换器,您可以在其中输入 python 文件并获得目标 c 文件? 或者它是一个可以导入到目标 c 文件中的库,让您可以在其中编写 python?

或者完全是另外一回事?

如果有人可以提供有关如何使用它的提示、它如何工作的概述,或者只是一些关于它的 hello world 的说明,我将非常感激。

I understand the concept of PyObjC, but can nowhere find any information on what exactly it is or how to get started with it.

Is it like a converter, where youinput python files and get an objective c one?
Or is it a library you can import to your objective c files which let's you write python in them?

Or is it something else entirely?

If anyone can give tips on how to approach it, an outline of how it works, or just some instructions on a hello world with it, I would be very grateful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

原来是傀儡 2024-10-05 00:45:21

它是一个语言绑定,这意味着它允许您从 Python 调用 ObjC 代码,反之亦然。您可以在 ObjC 中编写包装器模块,这些模块可以链接到 Python 解释器(用 C 编写),以使其能够访问 ObjC 函数(教程)。显然,整个 Cocoa 框架已经封装完毕,因此您可以轻松地从 Python 中使用它。

反之亦然,它使您能够将 Python 解释器链接到 ObjC 应用程序中,并使用它在应用程序中执行 Python 代码 (教程)。

It's a language binding, meaning it allows you to call ObjC code from Python and vice versa. You write wrapper modules in ObjC that can be linked into the Python interpreter (which is written in C) to give it access to ObjC functions (tutorial for this use case). Apparently, the entire Cocoa framework is already wrapped, so you can use that from Python with ease.

Vice versa, it enables you to link the Python interpreter into your ObjC app and use it to execute Python code in your app (tutorial).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文