Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a C++ Program from Django Framework

Tags:

c++

python

django

I need to run a C++ Program from Django Framework. In a sense, I get inputs from UI in views.py . Once I have these inputs, I need to process the input using my C++ program and use those results. Is it possible ?

like image 666
vishwanath Katharki Avatar asked Dec 22 '22 06:12

vishwanath Katharki


2 Answers

Compile that C++ program to executable and call with subprocess module from python

like image 81
YOU Avatar answered Dec 24 '22 19:12

YOU


You can use swig to create a C++ module that can be imported in python. An alternative is boost::python (but personnaly, I prefer swig).

like image 39
Tristram Gräbener Avatar answered Dec 24 '22 18:12

Tristram Gräbener