python - 在 Python ctypes 中加载 C 标准库的可移植方法

标签 python ctypes libc

有没有一种可移植的方式来在 Python ctypes 中加载 C 标准库(libc.solibc.dylib)?关于 platform.system() 的结果,我应该只使用 if/elif 语句吗?功能?

最佳答案

ctypes 库不提供任何此类性质的内容,因此 if 语句正是您所需要的。

关于python - 在 Python ctypes 中加载 C 标准库的可移植方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7926617/

相关文章:

python - GetProcAddress 返回值

rust - 如何实现将子进程的标准输出重定向到文件?

gcc - 我定义了一个名为 'free' : How to stop glibc's printf from using it? 的 C 函数

c - 使用来自非 C 程序的 C 库 : is it necessary to explicitely initialize the "under-the-hood" C library?

python - 正确,Matplotlib 中的 "full length"左右箭头?

python - Python 脚本中 NSPasteboard 输出中的额外字符

导入dll文件时python ctypes失败

python - 使用 ctypes libc.strlen 时总是返回 1?

python - 从字典中分配和调用内置函数 (Python)

python - 查明列表中是否没有项是字典中的键