-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpythoncpp.cpp
More file actions
42 lines (35 loc) · 762 Bytes
/
pythoncpp.cpp
File metadata and controls
42 lines (35 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* =====================================================================================
*
* Filename: pythoncpp.cpp
*
* Description:
*
* Version: 1.0
* Created: 2017年08月11日 14时22分14秒
* Last Modified: 2017年08月11日 14时22分14秒
* Revision: none
* Compiler: gcc
*
* Author: zt (),
* Organization:
*
* =====================================================================================
*/
//g++ -fPIC -shared -o a.so pythoncpp.cpp
// use in python:
// import ctypes
// a = ctypes.CDLL('./a.so')
// a.Test()
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
void Test()
{
printf ( "This is cpp Test\n" );
}
#ifdef __cplusplus
}
#endif