Example strings:
uji708
uhodih
utus29
agamu4
azi340
ekon62
I need to change them into CSV list like this:
uji708,uhodih,utus29,
agamu4,azi340,ekon62,
My code so far:
email = 'mail_list.txt'
handle = open(email)
for line in handle:
try:
email = line.split()[0].replace('\n', '')
l = line.split()
print '\n'.join((','.join(x) for x in zip(l[::3], l[1::3], l[2::3])))
except:
print 'error'
How can I do this in Python?