Skip to content

Instantly share code, notes, and snippets.

@pcote
Created February 4, 2016 23:47
Show Gist options
  • Select an option

  • Save pcote/3990dc7e8b37e92f2bff to your computer and use it in GitHub Desktop.

Select an option

Save pcote/3990dc7e8b37e92f2bff to your computer and use it in GitHub Desktop.
def pick_lines(file_name):
with open(file_name, "rt", encoding="utf-8") as fileob:
for line in fileob:
if line.strip().startswith("bl_region_type"):
yield line
for pyfile in pyfiles():
for line in pick_lines(pyfile):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment