1 // Copyright (C) 2010-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Adrien Bruneton (CEA)
22 #include <pqPVApplicationCore.h>
23 #include <QApplication>
24 #include "PyInterp_Utils.h"
25 #include "Container_init_python.hxx"
29 int main(int argc, char ** argv)
31 // Initialize Python in the way SALOME does:
32 KERNEL_PYTHON::init_python(argc,argv);
34 // The below should always work (illustration of SALOME lock protection)
36 PyLockWrapper lock; // if commented, the below will crash:
38 // Nothing important, just a bunch of calls to some Py* functions!
39 PyRun_SimpleString("import base64");
40 PyObject * sysmod = PyImport_AddModule("sys");
41 PyObject* sysdict = PyModule_GetDict(sysmod);
42 PyObject* tmp = PyDict_GetItemString(sysdict, "modules");
44 std::cout << "Done with Py call" << std::endl;
47 QApplication qtapp(argc, argv);
48 std::cout << "Done with Qt init" << std::endl;
50 // And finally the ParaView part:
51 pqPVApplicationCore* myCoreApp = new pqPVApplicationCore (argc, argv);
52 std::cout << "Done with PV init" << std::endl;
53 // Make sure compilation of ParaView was made with Python support:
54 if (!myCoreApp->pythonManager())
58 std::cout << "Done with PV deletion" << std::endl;