@atom: no a pynode is definitely not a single line affair
basically a Node is a class that is derived from the class Blender.Node.Scripted
It should have a public interface that defined a function call() that is called for every pixel.
But, like any Python class it can override its constructor (the init() function) and stuff all sorts of additional data in the instance. So you could open a file in the init() function, store the filehandle as instance data and write data to this file in every call to the call() function.
def init(self, sockets):
… define input and output sockets for the node …
… do things with input and output sockets here …
self.myfile.write(‘interesting stuff to write to file’)
Examples can be found on: