Is it possible to run a Qt gui application as a boost module through python? It was working as a standard C++ executable, but now I'm compiling it down to a shared library and trying to launch it from python. Right now it just goes into the python interpreter every time I run simpleMain() from the interpreter. As in, I get a new "Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)" greetings every time and my program segfaults when I close the interpreter. Also, I can't call the main function directly because I'm not sure how to convert a python list to a char*. A string to char seems to wrok naturally.
This is my python code to launch it:
import libsunshine
libsunshine.simpleMain()
and here's my C++ code:
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(libsunshine)
{
def("say_hello", say_hello);
def("simpleMain", simpleMain);
def("main", main);
}
int simpleMain()
{
char* args[] = {};
main(0,args);
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Sunshine w;
w.show();
return a.exec();
}