[Paraview-developers] Control paraview interactively using IDLE?

Cory Quammen cory.quammen at kitware.com
Fri Aug 4 10:38:20 EDT 2017


Amine,

No, you won't be able to use the Python API from within a binary you
have downloaded from paraview.org with Python 3. You would indeed need
to compile ParaView with Python 3. Doing so is officially supported
(we have regular test builds against Python 3), we just don't ship the
binaries with Python 3 for now. I'm not sure when we will ship
binaries with Python 3, perhaps in the next couple releases.

Best regards,
Cory


On Fri, Aug 4, 2017 at 10:29 AM, Amine Aboufirass
<amine.aboufirass at gmail.com> wrote:
> Hi Cory,
>
> Thanks for your response. That is quite unfortunate. I think it would be
> very helpful for new, inexperienced users to "play around" with the
> interface in such a manner. Of course, I am one of these inexperienced users
> and so I have no idea of the development effort it would take to be able to
> do such a thing.
>
> On another note, I would like to ask about python versioning for the
> existing Paraview API. As you might know python is up to version 3.6 now. As
> far as I'm aware Paraview.simple works only on Python 2.7? Most libraries
> are now using at least 3.4 or so, especially libraries I would like to use
> Paraview with.
>
> Is an upgrade of the Paraview module underway? If not would it be possible
> for a lambda user to recompile them into later versions of python and use
> them?
>
> I had one guy from kitware tell me the following:
>
>> No, recompilation is required to have the Python extensions using C to use
>> Python3. The easiest fix right now is to recompile ParaView yourself, sorry
>
>
> Of course I can try to recompile it but this would be a huge pain. So I
> don't want to embark on this adventure unless it is feasible within a
> reasonable time frame (which I doubt)....
>
> What's your take? Is it possible to use the API with Python 3?
>
> Regards,
>
> Amine
>
>
> On Sat, Jul 22, 2017 at 3:44 PM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>>
>> Amine,
>>
>> As far as I am aware, I'm afraid that you will not be able to control
>> the paraview UI from an external Python. The ParaView GUI owns its
>> internal Python environment, and the Python environment (including the
>> paraview.simple module) does not have a direct reference to the
>> ParaView GUI side of things. It may appear that you are controlling
>> the GUI via Python in ParaView's Python console, but that happens
>> indirectly. Your Python script change objects in ParaView, but the UI
>> changes you see are the result of observers in the UI listening for
>> updates to ParaView's state and updating themselves based on the new
>> values. The Python script does not control the UI elements directly.
>>
>> The reason you see a separate render window is because running pure
>> Python scripts through pvpython or pvbatch, which are basically Python
>> executables with some additional path information, is explicitly
>> supported - the lone window appears when rendering commands are issued
>> in the script. What you have done with an external (and compatible)
>> Python is also supported, but it does not let you invoke the GUI
>> application, let alone control it.
>>
>> Hope that helps,
>> Cory
>>
>> On Sat, Jul 22, 2017 at 2:02 AM, Amine Aboufirass
>> <amine.aboufirass at gmail.com> wrote:
>> > I am trying to control Paraview interactively using IDLE. This would
>> > involve
>> > sending commands from IDLE and seeing the changes occur in Paraview. I
>> > would
>> > rather not use the in-Paraview python shell.
>> >
>> > So far, I have succeeded in importing the Paraview modules (simple,
>> > servermanager…etc) from IDLE. However the commands sent do not reflect
>> > in
>> > Paraview. For instance:
>> >
>> >>>> from paraview.simple import *
>> >>>> cone = Cone()
>> >>>> Show()
>> >>>> Render()
>> >
>> > does indeed create a cone. However the cone is output to a new,
>> > independent
>> > OpenGL window, and not the Paraview GUI.
>> >
>> > Is it possible to control Paraview interactively using IDLE? If so how
>> > to
>> > accomplish this? Thanks
>> >
>> >
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Search the list archives at:
>> > http://markmail.org/search/?q=Paraview-developers
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/mailman/listinfo/paraview-developers
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the Paraview-developers mailing list