[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] PyQt5 and temporary python interpreter in a C++ program
From:       Pierre Barbier de Reuille <pierre () barbierdereuille ! net>
Date:       2015-05-21 8:32:46
Message-ID: CAPFL7Fn1OJRjxLk30yPZ5Dbr1EMyDWyrZUXLUx341qdpkv_9tQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Ok, that's too bad :(
So I guess for now I'll keep a single interpreter for the whole time, and
if it ever gets fixed I'll be able to start/stop the interpreter ...

Thanks anyway,

Pierre

On Mon, 18 May 2015 at 19:32 Phil Thompson <phil@riverbankcomputing.com>
wrote:

> On 18/05/2015 6:19 pm, Pierre Barbier de Reuille wrote:
> > Hi,
> >
> > I have a C++ application that can be scripted with Python. As the
> > scripting
> > is very localized in time, I had originally chosen to initialize the
> > interpreter before each script, and finalize it after each script.
> >
> > This worked very well until I tried to use PyQt5 in my scripts! If I do
> > that, it works the first time, but on the next initialization, all the
> > modules are close to empty. In particular, they don't have any classes!
> >
> > As a temporary solution, I initialize the interpreter once at the start
> > of
> > my application, and re-use it over and over. But this is not ideal! In
> > particular, that would allow for resources leaks, which I would like to
> > avoid. Is this a known issue with PyQt? Is there something I can do to
> > make
> > this work?
>
> Neither sip or PyQt do a very good job about tidying up on finalisation.
> There is no one specific thing - just lots of little ones. Fixing it has
> just been low priority.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div>Ok, that&#39;s too bad :(<br></div>So I guess for now \
I&#39;ll keep a single interpreter for the whole time, and if it ever gets fixed \
I&#39;ll be able to start/stop the interpreter ...<br><br></div>Thanks \
anyway,<br><br></div>Pierre<br></div><br><div class="gmail_quote">On Mon, 18 May 2015 \
at 19:32 Phil Thompson &lt;<a \
href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>&gt; \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">On 18/05/2015 6:19 pm, Pierre Barbier de Reuille \
wrote:<br> &gt; Hi,<br>
&gt;<br>
&gt; I have a C++ application that can be scripted with Python. As the<br>
&gt; scripting<br>
&gt; is very localized in time, I had originally chosen to initialize the<br>
&gt; interpreter before each script, and finalize it after each script.<br>
&gt;<br>
&gt; This worked very well until I tried to use PyQt5 in my scripts! If I do<br>
&gt; that, it works the first time, but on the next initialization, all the<br>
&gt; modules are close to empty. In particular, they don&#39;t have any classes!<br>
&gt;<br>
&gt; As a temporary solution, I initialize the interpreter once at the start<br>
&gt; of<br>
&gt; my application, and re-use it over and over. But this is not ideal! In<br>
&gt; particular, that would allow for resources leaks, which I would like to<br>
&gt; avoid. Is this a known issue with PyQt? Is there something I can do to<br>
&gt; make<br>
&gt; this work?<br>
<br>
Neither sip or PyQt do a very good job about tidying up on finalisation.<br>
There is no one specific thing - just lots of little ones. Fixing it has<br>
just been low priority.<br>
<br>
Phil<br>
_______________________________________________<br>
PyQt mailing list      <a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></blockquote></div>



[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic