Re: [Tutor] writing files using modules and functions

2012-11-13 Thread Dave Angel
On 11/13/2012 01:43 AM, Rufino Beniga wrote: > def MatInv(arr,file): > f = open('file.txt','w') > f.write(arr) > f.close() > > So I'm trying to write a module that will take a matrix (arr) and write it > to a text file. > The above module is called MatrixIO.py > > #first I import it > >

Re: [Tutor] writing files using modules and functions

2012-11-13 Thread Alan Gauld
On 13/11/12 06:43, Rufino Beniga wrote: def MatInv(arr,file): f = open('file.txt','w') f.write(arr) f.close() So I'm trying to write a module that will take a matrix (arr) and write it to a text file. The above module is called MatrixIO.py #first I import it import MatrixIO #Th

[Tutor] writing files using modules and functions

2012-11-12 Thread Rufino Beniga
def MatInv(arr,file): f = open('file.txt','w') f.write(arr) f.close() So I'm trying to write a module that will take a matrix (arr) and write it to a text file. The above module is called MatrixIO.py #first I import it import MatrixIO #Then i call the function MatInv with matrix(a)