Skip to content

Commit 587542f

Browse files
committed
Add minimal_embedded_python/
1 parent 1ec5325 commit 587542f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -x
2+
clang++ -std=c++11 -I/usr/include/python3.11 -g -O0 show_python_datetime_now.cpp -o show_python_datetime_now -lpython3.11
3+
./show_python_datetime_now
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <Python.h>
2+
3+
int main(int /*argc*/, char * /*argv*/[]) {
4+
const char *simple_string = "import datetime\n"
5+
"print(datetime.datetime.now())\n";
6+
Py_Initialize();
7+
PyRun_SimpleString(simple_string);
8+
Py_Finalize();
9+
return 0;
10+
}

0 commit comments

Comments
 (0)