Please tell me what I'm doing wrong.
I have a list, and I want python to make a file out of it.
def changename(filename, modifier):
return filename[:4]+modifier+filename[-4:]
def fileWrite(filename, ext, sortedList):
openthis =open(okfilename(changename(filename,'_'+ext)),'wb')
for item in sortedList:
openthis.write(item)
openthis.write('\n')
return
lastnames.append(newNames)
lastnames.sort()
print '\n'.join(lastnames)
names.close()
fileWrite(filename, "Last-sorted", lastnames)