Skip to content

Instantly share code, notes, and snippets.

@DZwell
Created March 4, 2016 20:01
Show Gist options
  • Select an option

  • Save DZwell/eb479bab8f969e8bf9a4 to your computer and use it in GitHub Desktop.

Select an option

Save DZwell/eb479bab8f969e8bf9a4 to your computer and use it in GitHub Desktop.
import io
def read_file(file):
"""Return opened file."""
text = []
f = io.open(file, 'r')
for line in f:
if '***' not in line:
text.append(line)
else:
break
return text
read_file('corpora.txt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment