autoCppToPy
1.0.0
P : ¿Qué es la autocppty?
R : AutoCpPTopy es una forma fácil y rápida de compilar el código C ++ en un módulo Python
P : ¿Cómo funciona la autocpptopy debajo del capó? R : AutoCpPTopy usa pybind11 para compilar su código C ++ en un módulo Python
P : ¿Cómo puedo usar CPPTopy A : AutoCpPTopy se puede importar a su código Python, lo que le permite compilar cualquier archivo C ++ usted mismo usando AutocpPTopy, o se puede usar directamente en la línea de comandos
(* = requerido)
python -m cpptopy -f <source file*> --header <header file*> -o <package name*> -l <language name = "C++"> --auto-stubs <generate auto .pyi files = False>
Main.HPP:
int add ( int a, int b);main.cpp:
# include " main.hpp "
int add ( int a, int b) {
return a + b
}CLI:
python -m cpptopy -f "main.cpp" --header "main.hpp" -o "my_module" --auto-stubs True
Main.py
import my_module
my_module . add ( 2 , 3 ) # 5