You need to specify different file names:
lst = ['hello world', 'hi I am Josh']
index = 0
for wd in lst:
with open('hey%s.txt' % index, 'wb') as f:
f.write(wd)
index += 1
This will output "hello world" in hey0.txt and "hi I'm Josh" in hey1.txt
You can event replace the:
open('hey%s.txt' % index
part with:
open('hey%s.txt' % (index if index else '')
This way you'll have "hey.txt" and "hey1.txt" (it does not append the index if it equals 0)