Is there anything which gets the lines of given pattern in python like we have in powershell
$Response2.RawContent -split "`n" | Select-String $ans -Context 1,4
in powershell it is getting 1 line before and 4 lines after the line in which matched string found.
I'm new to python, worked more on powershell. Kindly help me on this.