So your psuedo code looks like this:
Code:
Open File
while there are lines to be read in file
Store each line as a temporary String
If string does not match '^-+$' add string to output array
Close file
Foreach entry in output array
print string
Now for the match I'd recommend something like re.compile('^-+$').search(tmpstr,1) Here's a link to the pydoc for re
http://docs.python.org/lib/module-re.html