python script to disp results in both text and JSON format