http://qs1969.pair.com?node_id=963002


in reply to Re: How to find that a line "genman.py" exists in a python file
in thread How to find that a line "genman.py" exists in a python file

or, if the OP happens to be on Windows, findstr will do the same thing:
findstr /c:"genman.py" C:\python.py findstr /v /c:"genman.py" C:\python.py