Added optional file output to python decoder