Skip to content

Instantly share code, notes, and snippets.

@KIDJourney
Created January 10, 2016 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KIDJourney/869baeb768c3ea743277 to your computer and use it in GitHub Desktop.
Save KIDJourney/869baeb768c3ea743277 to your computer and use it in GitHub Desktop.
f = open('file.txt')
output1 = open('contained.txt','w')
output2 = open('notcontained' , 'w')
rule = 'aeoiu'
for line in f.readlines():
result = [i for i in rule if i in line]
if result:
output1.write(line)
else :
output2.write(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment