Support Questions

Find answers, ask questions, and share your expertise
Announcements
Welcome to the upgraded Community! Read this blog to see What’s New!

NiFi: ExecuteStreamCommand STDIN and STDOUT

avatar

Hi,

Can some one please give an example of STDIN and STDOUT in python script to take input from Nifi flowfile and paas the output file to NiFi flowfile again. I am using below script for STDIN and STDOUT. STDIN seems to be working fine but STDOUT is not working. Please help

 

f = sys.stdin
reader = csv.reader(f)

***********

##Python code for creating the output file and passing it to STDOUT

xmlfile = open("C:\\Output_from_python\\output_file.xml",'w')
xmlFile.write(doc.toprettyxml(indent = '\t'))
xmlFile.close()
sys.stdout = xmlFile

 

1 REPLY 1

avatar
Explorer

Just simple print it.

Labels