Any particular reason you are using the "Python Node" vs "Generate Data" or the Transform node? The syntax for that node is slightly different as it's typically used for legacy dataflows/graphs. The new nodes are much simpler to use.
Regardless, here is the syntax for the legacy "Python Node" (make sure you are using tabs for indention)
To create the output column on the output pin use this:
pathName = "mypath" #Example variable
self.som = self.newMetadata() #Create output metadata
self.som.append("Path","string") #Create a new field called Path
self.outputs[0].metadata = self.som #Add metadata to the output pin
To populate use this:
outSchemaRec = self.outputs[0].newRecord() #Create a new output record
outSchemaRec[0] = pathName #Set the value of the new field
self.outputs[0].write(outSchemaRec) #Write the output record
