Knime python console output for statistical result should be able to "copy" or "Generated" as it is

@knime200087 what you can do is capture the output into a text file and store that. This code sample is from this workflow, assuming you have a path variable (string) where to store the file (var_path_validate) and a model name (var_model_name_full):

var_txt_summary = knio.flow_variables['var_path_validate'] + var_model_name_full + ".txt"

# bring the path of the summary back to KNIME as Flow Variable
knio.flow_variables['var_txt_summary'] = var_txt_summary

# capture the model summary in an TXT file
import sys
sys.stdout = open(var_txt_summary, 'w')

# do whatever it is that should be captured
print(extracted_model)
sys.stdout.close()
4 Likes