read max 1 megabyte of output of python script

Output can be too large because of mistakes in python scripts.