autoCppToPy
1.0.0
F : Was ist AutoCPPTopy?
A : AutoCPPTopy ist eine einfache und schnelle Möglichkeit, C ++ - Code in ein Python -Modul zu kompilieren
F : Wie funktioniert die AutoCPPTopy unter der Motorhaube? A : AutoCPPTopy verwendet Pybind11, um Ihren C ++ - Code in ein Python -Modul zu kompilieren
F : Wie kann ich CPPTopy A verwenden.
(* = erforderlich)
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