[Paraview] TypeError: WriteImage() takes exactly 3 arguments (1 given)

Anton Shterenlikht mexas at bristol.ac.uk
Mon Mar 18 16:01:43 EDT 2013


	From sebastien.jourdain at kitware.com Mon Mar 18 17:18:10 2013

	Probably because in the documentation
	 the WriteImage() used is a function
	and not a method on the view proxy.

	>>> WriteImage("/tmp/image.png")

I actually figured this out.
The "servermanager" module requires 3 parameters,
while the "simple" module requires only 1 parameter,
the other are options.

The problem is that different tutorials and books
use either servermanager or simple, so it's easy
to get confused. It seems "simple" is more modern,
but at least in my 3.10 both are supported.
The 2007 paper edition of the paraview user guide
uses "servermanager" exclusively. I'm looking forward
to receiving the 2012 paraview guide, which presumably
will refer to "simple".

Anton


	On Thu, Mar 14, 2013 at 11:28 AM, Anton Shterenlikht <mexas at bristol.ac.uk>wrote:

	> I get this error:
	>
	> >>> view.WriteImage("z.png")
	> Traceback (most recent call last):
	>   File "<stdin>", line 1, in <module>
	>   File
	> "/usr/local/lib/paraview-3.10/site-packages/paraview/servermanager.py",
	> line 331, in __ConvertArgumentsAndCall
	>     retVal = func(*newArgs)
	> TypeError: WriteImage() takes exactly 3 arguments (1 given)
	> >>>
	>
	> The tutorial suggests that just the filename is enough:
	>
	> http://paraview.org/Wiki/ParaView/Python_Scripting
	>
	> Anyway, I can see in other examples that the second argument
	> is the file format, e.g.:
	>
	> view.WriteImage("z.png","vtkPNGWriter")
	>
	> but this gives the same error:
	>
	> >>> view.WriteImage("z.png","vtkPNGWriter")
	> Traceback (most recent call last):
	>   File "<stdin>", line 1, in <module>
	>   File
	> "/usr/local/lib/paraview-3.10/site-packages/paraview/servermanager.py",
	> line 331, in __ConvertArgumentsAndCall
	>     retVal = func(*newArgs)
	> TypeError: WriteImage() takes exactly 3 arguments (2 given)
	> >>>
	>
	> I cannot find what the third argument must be.
	>
	> Please help
	>
	> Anton


More information about the ParaView mailing list