[Paraview] Threads in the python shell
Pat Marion
pat.marion at kitware.com
Wed Jan 11 15:05:20 EST 2012
Dave's right, you can't use python threads in the paraview python shell.
After your while loop exits, control is returned to the Qt event loop and
the python thread has no chance to cycle. It might work if you try
pvpython instead.
You could also try a plugin I wrote last year... you have to compile it,
but then you can do everything from python, no additional recompiling. It
adds UI for creating remote control sockets in the paraview gui, and all
character data received on the socket is executed directly in the python
shell. I just put it up on github:
https://github.com/patmarion/ParaViewSocketPlugin
Pat
On Wed, Jan 11, 2012 at 12:50 PM, David E DeMarle
<dave.demarle at kitware.com>wrote:
> No pythreads in paraview for you!
>
> Sorry. See "gitk 106fd270" for some of the history behind that.
>
> I am guessing it would take a significant amount of work to make it all
> work right. Hopefully others on the list will correct me.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Wed, Jan 11, 2012 at 12:43 PM, Felipe Bordeu <
> felipe.bordeu at ec-nantes.fr> wrote:
>
>> Hello,
>>
>> I want to use a tablet (android) to control the GUI (rotation, pan,
>> zoom) in paraview.
>> In the python shell a made network connection (socket) the sent command
>> that I translate into paraview commands (this work ok).
>>
>> The problem is that the GUI is not respond to the user iterations during
>> the network iteration (I have a while loop in the python):
>>
>> so the idea was to create a thread to treat all the network commands, but
>> the code in the second thread is executed only for the time the main thread
>> is running.
>> a example code is attached (very little code).
>>
>> can I use threads inside paraview python shell, or I have to use c++???
>> (I prefer python, no need to recompile)
>>
>> --
>>
>> Felipe Bordeu Weldt
>> Ingénieur de Recherche
>> ------------------------------**-------
>> Tél. : 33 (0)2 40 37 16 57
>> Fax. : 33 (0)2 40 74 74 06
>> Felipe.Bordeu at ec-nantes.fr
>> Institut GeM - UMR CNRS 6183
>> École Centrale Nantes
>> 1 Rue de La Noë, 44321 Nantes, FRANCE
>> ------------------------------**-------
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120111/a8b9a909/attachment.htm>
More information about the ParaView
mailing list