The main problem with your code (aside from the fact that you keep
posting invalid Python code) is that you keep overwriting your files in
the loop because the filenames are not unique across the loop. So you
should try something like..
for tr in stream:
filename = '%s_%s.mseed' % (
tr.id, tr.stats.starttime.strftime('%Y-%m-%dT%H%M%S'))
tr.write(filename, format='mseed')
If you want to post more questions please take at least the time to post
syntactically valid Python code that you verified locally on your computer.