第一步,建立一个CPP的DLL工程,然后写如下代码,生成DLL
复制代码 代码如下:#include <stdio> #define DLLEXPORT extern “C” __declspec(dllexport) DLLEXPORT int __stdcall hello() { printf(“Hello world!\n”); return 0; }
第二步,编写一个 python 文件:复制代码 代码如下:# coding: utf-8 import os import ctypes CU