Writing A Matrix To A File Python