摘要: from types import MethodType, FunctionType class Foo(object): def __init__(self): self.name = "MyName" def func(self): print(self.name) obj = Foo() pr 阅读全文
posted @ 2022-01-19 22:39 emanlee 阅读(92) 评论(0) 推荐(0)
摘要: 转自:https://github.com/jobbole/awesome-python-cn 资源列表 环境管理 管理 Python 版本和环境的工具 p:非常简单的交互式 Python 版本管理工具。 pyenv:简单的 Python 版本管理工具。 Vex:可以在虚拟环境中执行命令。 virt 阅读全文
posted @ 2022-01-19 10:44 emanlee 阅读(452) 评论(0) 推荐(0)
摘要: 第一种、Python调用C动态链接库(利用ctypes) 下面示例在linux或unix下可行。 pycall.c 1 2 3 4 5 6 7 8 /***gcc -o libpycall.so -shared -fPIC pycall.c*/ #include <stdio.h> #include 阅读全文
posted @ 2022-01-19 10:29 emanlee 阅读(783) 评论(0) 推荐(0)