Python Write File To Memory