Read MNIST DATA SET and write data into txt file(based python)