TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Writing a Python C extension in 2018

6 点作者 jbaviat大约 7 年前

1 comment

jbaviat大约 7 年前
I&#x27;m the author of <a href="https:&#x2F;&#x2F;github.com&#x2F;sqreen&#x2F;PyMiniRacer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sqreen&#x2F;PyMiniRacer</a>, used as example in this deck.<p>I introduce how I leveraged ctypes + Python manylinux wheels (PEP513 &#x2F; PEP571) in order to allow loading V8 easily into Python, without requiring local compilation on install nor having us maintaining a huge test matrix:<p><pre><code> $ pip install py-mini-racer $ python &gt;&gt;&gt; from py_mini_racer import py_mini_racer &gt;&gt;&gt; ctx = py_mini_racer.MiniRacer() &gt;&gt;&gt; ctx.eval(&#x27;1+1&#x27;) 2 </code></pre> So this shared object could be used in any language allowing to interact with arbitrary shared objects (e.g. Ruby with fiddle).