I have a series of strings in a file of the format:
>HEADER_Text1
Information here, yada yada yada
Some more information here, yada yada yada
Even some more i
As noted in the comments, your best bet is to use an existing FASTA parser. Why not?
Here's how I would join lines based on the leading greater-than:
def joinup(f):
buf = []
for line in f:
if line.startswith('>'):
if buf:
yield " ".join(buf)
yield line.rstrip()
buf = []
else:
buf.append(line.rstrip())
yield " ".join(buf)
for joined_line in joinup(open("...")):
# blah blah...