CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Image Paraview with Python

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2017, 05:23
Arrow Image Paraview with Python
  #1
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello to all,
my teacher asked me to find a manner to produce a series of images and to automate this procedure because we have to make different test for the colour etc. After a rapid search i (maybe) understand that this could be made by the use of a python script.
I initially built Paraview with OpenFOAM but then i noticed this is an incomplete version because it hadn't let to save .pdf image. So i installed a "stand alone" version and now i wan to to produce an image through a python script.

I test this one find in the web

Code:
from paraview.simple import *
simple.Sphere()
simple.Show()
simple.Render()
simple.WriteImage("foo.png")
but, unfortunatley, when i run this script an errorr occurs and it does not load the module.

Code:
Traceback (most recent call last):
  File "ciao.py", line 2, in <module>
    from paraview.simple import *
ImportError: No module named 'paraview'

i use python3
What's i'm doing wrong?

Thanks for help
FlyBob91 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[General] Listing the inputs of a grouped dataset with a programmable python filter in Paraview NadineHS ParaView 3 December 12, 2021 14:54
[OpenFOAM] Paraview from python shell : Glew initialization and VTKcommoncorepython error pradyumnsingh ParaView 0 September 18, 2018 13:40
[General] Loading .stl file with python shell in paraview New-to-CFD ParaView 2 May 23, 2017 12:31
[OpenFOAM.org] OF 2.3.0 compiling Paraview with "-python -mpi" bender.rodriguez OpenFOAM Installation 5 December 14, 2014 12:27
How to get Python Shell into ParaView 3.8.1? blaise OpenFOAM Installation 3 July 24, 2012 04:58


All times are GMT -4. The time now is 01:52.