Max Erickson wrote: >> # w is for writing >> myfile = open('theoutfile',w) > > That won't work, the second argument to open needs to be a string: w = 'w' </F>