Echo last output [Maya, Python]

hey guys,
just had a couple questions that I’d be grateful to get an answer to:

1)I want to echo the last output in the script editor history for a set amount of lines.

2)I’m going to run the script as a post-render script(MEL call to a py script) and I’d like to be able to check if the render was invoked as a single render or as a batch render.

Thanks very much!

scriptEditorInfo -input “”;
scriptEditorInfo -historyFilename “tempHistoryLog.txt” -writeHistory true;

// Do your render

scriptEditorInfo -writeHistory false;

// read the contents of tempHistoryLog.txt for the information you need

Thanks! That works great.