python - Cython,调用 shell 命令。性能提升
问题描述
我的问题很简单。使用 Cython 与纯 Python 调用 shell 命令或操作系统上存在的任何其他二进制可执行文件有什么好处吗?
解决方案
而不是os.system()
? 并不真地。
的实现os.system()
基本上是(删除了一些宏):
static long
os_system_impl(PyObject *module, const Py_UNICODE *command)
{
long result;
if (PySys_Audit("os.system", "(u)", command) < 0) {
return -1;
}
result = _wsystem(command);
return result;
}
推荐阅读
- python - 为什么我看不到来自 android 设备的 python 构建访问点?
- ios - iOS 15 上查询 Focus 模式的 API 是什么?
- sql - 具有分组查询的连接字符串
- r - 如何获得 x 轴上每个值的分组箱线图?
- sql - PostgreSQL 在当前时区获取结果
- angular - 重新加载 Angular SSR 时出现 504 网关错误
- flutter - 在颤动中使用动画包我的动画不流畅
- python - 如何打印多元线性回归模型(r2 等)的结果摘要 - Statsmodels vs SciKitLearn
- ruby-on-rails - 将 rails 从 4.x 升级到 5.x 时出现问题
- symfony - 升级easyadmin bundle symfony 时路由改变