Skip to content

Instantly share code, notes, and snippets.

@amkatrutsa
Created October 22, 2014 10:47
Show Gist options
  • Select an option

  • Save amkatrutsa/ee6593a00fcca165ae78 to your computer and use it in GitHub Desktop.

Select an option

Save amkatrutsa/ee6593a00fcca165ae78 to your computer and use it in GitHub Desktop.
def process_line(line, t2i, i2t, outfile):
'''
Find all person's ID, They have to link to the category
'Living_people'
'''
pattern = "\((\d+),'(.*?)',(.*?)\)"
current_page = None
for match in finditer(pattern, line):
topage, category, t = match.groups()
if category == "Living_people":
outfile.write(topage)
outfile.write('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment