Switching to getting output from Python function instead of arbitrary shell commands.