On Mon, Mar 5, 2012 at 6:35 PM, Joel Goldstick <joel.goldst...@gmail.com> wrote: > On Mon, Mar 5, 2012 at 6:20 PM, Alan Gauld <alan.ga...@btinternet.com> wrote: >> On 05/03/12 21:25, Dave Angel wrote: >> >>> It's not clear what __add__() should mean for physical files. >> >> >> My guess would be similar to the cat operator in Unix: >> >> $ cat file1, file2 > file3 >> >> is equivalent to >> >> file3 = file1 + file2 >> >> But of course, thats just my interpretation of file addition... >> >> -- >> Alan G >> Author of the Learn to Program web site >> http://www.alan-g.me.uk/ >> >> >> _______________________________________________ >> Tutor maillist - Tutor@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor > > if spss files are text (not binary) why not: > oops forgot the dots.
> f1 = open("f1").read() > f2 = open("f2").read() > > outfile = open("outfile", "w") > outfile.write(f1 + f2) > outfile.close() > > You could put this in a function and pass all infiles as *filenames, > then loop to read each file and output result > > > > -- > Joel Goldstick -- Joel Goldstick _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor