RosettaCodeData/Task/Search-in-paragraphs-text/Python/search-in-paragraphs-text.py

14 lines
309 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
with open('Traceback.txt', 'r' ) as f:
rawText = f.read()
paragraphs = rawText.split( "\n\n" )
for p in paragraphs:
if "SystemError" in p:
index = p.find( "Traceback (most recent call last):" )
if -1 != index:
print( p[index:] )
print( "----------------" )