![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
thulpf
这个作者很懒,什么都没留下…
展开
-
python 加载c/c++动态库流程小记
1.加载动态库主要用到ctypes from ctypes import * 2.使用CDLL或者cdll.LoadLibrary方法 libc = cdll.LoadLibrary("./example.so") 或 libc = CDLL("./example.so") 3.指定接口函数 func = libc.HelloWorld 4.指定返回值类型,默认为int型,即原创 2012-12-05 17:11:47 · 858 阅读 · 0 评论 -
python 获取命令行参数小记
python脚本传入的参数储存在sys的argv中 如果不需要处理命令行选项,则可以简单的通过对argv遍历来获取命令行参数,如 import sys for i in range(1,len(sys.argv)): print sys.argv[i] 如果需要处理命令行选项,需要用到getopt,如下所示 import sys, getopt opt, args = getopt原创 2012-12-06 14:07:06 · 550 阅读 · 0 评论