[Paraview] Write to file in python programmable filter

Ganesh Vijayakumar ganesh.iitm at gmail.com
Wed Jun 26 00:13:28 EDT 2013


hi !

  I have some stuff like this in a python programmable filter.

pressureForce = inputs[0].PointData['pressureForce']

viscousForce = inputs[0].PointData['viscousForce']

points = inputs[0].Points

with open('blah','w') as f:

     for i in range(size(points,0)):

          f.write("%s %s \n" % (pressureForce[i,0], viscousForce[i,0]))


 Now this creates problems when I run it in parallel. I have tried using
CSV writers... they output all data and not just what I want. Any chance I
can write it on my own? I would prefer to write just the data I want in
binary (e.g pickle) since I'm going to be writing a LOT of data.


ganesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130626/c2f23b83/attachment.htm>


More information about the ParaView mailing list