[review] Re: [PyKDE] Embedded python

David Boddie david at boddie.org.uk
Wed Jun 2 16:40:00 BST 2004


On Wed Jun 2 15:28:00 2004, Kevin Schmidt kevin at eyesopen.com wrote:

> However, if I try:
> 
> from qt import *
> q=QObject()
> p=QObject(p)
> print p.parent()
> 
> It crashes when I try to compile (via Py_CompileString(c_line, "", 
> Py_single_input)) the "print p.parent()" line.

I would have thought that the string "print p.parent()\n" would compile
without any problems, since the compiler only cares about the syntax used,
not whether the objects mentioned behave in the way you expect. The
problems should occur when you try to execute the code object returned
by Py_CompileString.

Can you post an excerpt from your C code where you do this, or try to
collect some error messages using the PyErr_Print() function?

Without knowing more about the environment you are running the interpreter
in, or seeing any debug output, it is difficult to diagnose the problem you
are seeing.

David




More information about the PyQt mailing list