Hi,<br>  After a big fight, I could get through the problem. I am posting it so that others does not waste  time solving the issue.<br>I dont know why "evalfile" method is having problems with existing .pyc files. But, we can solve it this way.<br>
First create your .cpp and .py file in <somedir> directory. Then, do the following<br>1. Create somename.qrc file  <br> <!DOCTYPE RCC><RCC version="1.0">
<br> <qresource>
<br>     <file>Filename.py</file> 
<br> </qresource>
<br> </RCC>
2. Navigate to the directory <somedir>. Type the command: qmake -project (It creates project (.pro) file)<br>3. Next command: qmake (It creates a make file). <br>4. Then update the makefile  INCPATH to add for Python and Python-Qt <br>
-I/usr/include/python2.5 -I/home/workspace/PythonQt-1.0/src<br>5. Update the LIBS  -L/usr/lib/python2.5/config/libpython2.5.a -L/home/workspace/PythonQt-1.0/lib -lpython2.5 -lPythonQt<br>WARNING: Always use ":<pythonfilename>" in your cpp file eval command. Then only Qrc will be used to create the corresponding. pyc file. Otherwise, the terminal will crash.<br>
Now issue the command "make" and run your application. Things work fine now.<br><br>I am not very clear with QRC but its a very good solution.<br><br>Rgds,<br>Shankar<br><br><br><div class="gmail_quote">On Fri, Jun 27, 2008 at 2:41 PM, Shankar Narayana <<a href="mailto:shank.nasa@gmail.com">shank.nasa@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br> I am newbie to PythonQt. I wanted to access the Qt objects created in C++ using Python and update things. I had a look at this URL "<a href="http://doc.trolltech.com/qq/qq23-pythonqt.html#decoratorsandcwrappers" target="_blank">http://doc.trolltech.com/qq/qq23-pythonqt.html#decoratorsandcwrappers</a>" which talks about using PythonQt for the same.<br>

  I followed the instructions given in the example. I created my cpp file and .py file and could make them working. <br>  But once after the first time after .pyc file is created, my program no longer executes. It is giving me a segmentation fault. If I remove my .pyc file and run the program, things work fine. <br>

<br>My cpp file<br>#include <QApplication><br>#include <QTextEdit><br>#include "PythonQt.h"<br>int main(int argc, char* argv[])<br>{<br>    QApplication app(argc,argv);<br>    QTextEdit *welcomemsg = new QTextEdit("Hi whatsup");<br>

    PythonQt::init(); 
<br>    PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();<br>    mainModule.addObject("welcomemsg",welcomemsg);  // Check with different names<br>    mainModule.evalFile("Pyscript.py");<br>

    mainModule.removeVariable("welcomemsg");<br>    PythonQt::cleanup(); <br>    return app.exec();<br>}<br><br>My Python file  (Pyscript.py)<br><br>from PythonQt import *<br>#append the text to the existing text edit<br>

welcomemsg.append("Hurray I did it")<br>welcomemsg.show()<br><br>Can somebody help me what makes this not to run once Python interpreter works on the Python file and creates a .pyc file ?<br> <br><br>Regards,<br>
<font color="#888888">
Shankar<br>
</font></blockquote></div><br>