[PySide] using QProcess to run python function

Frank Rueter | OHUfx frank at ohufx.com
Sun Jul 26 08:21:30 CEST 2015


Looks like I finally got what I was after.
This thread seems to be the solution for my situation (combined with 
Sean's QThreadPool example):
http://stackoverflow.com/questions/8356336/how-to-capture-output-of-pythons-interpreter-and-show-in-a-text-widget

Thanks everybody for bearing with me.
frank

On 24/07/15 09:17, Frank Rueter | OHUfx wrote:
> Hi Florian,
> thanks for the reply. This entire thread was posted here, not sure why 
> it wouldn't show up for you.
>
> >>it all really depends on how dummyFunction() looks and how it prints 
> to stdout.
> It's python code that calls calls other python code which eventually 
> calls external image processing programs to do some heavy lifting, 
> which print their progress to stdout. E.g.:
> dummyFunction() calls fucntionA() which calls fucntionB() which runs 
> the external program via Popen.subprocess.
>
> I'm happy to restructure a bit as long as the functions that deal with 
> managing the external program stay non-QT so they can be used via 
> command line without QT present.
>
> Cheers,
> frank
>
>
> On 23/07/15 7:22 pm, Florian Bruhin wrote:
>> (disclaimer: I didn't read your whole quoted private discussion as
>> this seems to be the first mail going to the pyside mailinglist)
>>
>> * Frank Rueter | OHUfx<frank at ohufx.com>  [2015-07-23 16:05:05 +1200]:
>>> [...]
>>> The question is how do I emit the stdout from dummyFunction() while it's
>>> running (it takes a minute or so to finish all sorts of tasks)? Do I have to
>>> move it to an extra thread again and connect to that?
>> There are some solutions I can imagine for this - but it all really
>> depends on how dummyFunction() looks and how it prints to stdout.
>>
>> (Can't you just make it do something more sane than printing to
>> stdout?)
>>
>> Florian
>>
>
> -- 
> ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
> <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
> and consulting <http://ohufx.com/index.php/vfx-customising>* *
>
>
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20150726/79b57fa1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20150726/79b57fa1/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ohufxLogo_50x50.png
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20150726/79b57fa1/attachment-0001.png>


More information about the PySide mailing list