Ah, I found a workaround: savetxt() can work with a StringIO -> savetxt(file_buffer, A) This is only a workaround. I still think A.tofile() should be capable of writing into a StringIO. -- O.C.