try with for word in line.split('ZZ'):
instead of for word in line[0].split('ZZ'):
.
This file[0].split('ZZ'):
returns list of strings, so line
is one of those strings.
line.split('ZZ')
will return list of strings once again, but now word
will be one of those strings.
EDIT Here is example for your question in comment:
line = "one-two threeZZfour five-six seven eight nineZZten"
for word in line.split('ZZ')
print word
output>>
one-two three
four five-six seven eight nine
ten
for word in line.split('-')
print word
output>>
one
two threeZZfour five
six seven eight nineZZten
for word in line.split()# or split(' ')
print word
output>>
one-two
threeZZfour
five-six
seven
eight
nineZZten