[docs] Py_Initialize() , use matplotlib , Py_Finalize() then Py_Initialize() , then matplotlib , it doesn't works and go wrong

XingHua Ma aaqqxx1910 at gmail.com
Wed Apr 11 16:45:13 CEST 2012


----------------------------------

test.cpp:

#include<Python.h>
void test2()

{
// int b;
Py_Initialize();
PyRun_SimpleString(“from matplotlib.pyplot import plotfile\n”
“from pylab import show\n”
“plotfile(‘/home/huskier/Desktop/data’)\n”//data file is just nums of 10
rows
“show()\n”);
Py_Finalize();
}

int
main(int argc,char *argv[])
{
test2();
test2();
return 0;
}

------------------------

How to work well?And the memory cann't free when use test2() in QT,if you
plot many times at once.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120411/15a6f2de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: draw_test.tar
Type: application/x-tar
Size: 266240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/docs/attachments/20120411/15a6f2de/attachment-0001.tar>


More information about the docs mailing list