Skip to content

Instantly share code, notes, and snippets.

@mwhooker
Created January 28, 2010 07:32
Show Gist options
  • Save mwhooker/288527 to your computer and use it in GitHub Desktop.
Save mwhooker/288527 to your computer and use it in GitHub Desktop.
import re
def country_finder(adj):
f = open('Acarnania.txt')
countries = []
for line in f:
results = re.split(',' , line.strip())
if len(results) >=2:
countries.append(results)
print countries
return [row[0] for row in countries if row[1] == adj]
#Usage: print country_finder('americans')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment