1 2 3 4 5 6 7 8 9 | #open file using open file mode fp = open('raw_corpus.txt') # Open file on read mode lines = fp.read().split("\n") # Create a list containing all lines fp.close() # Close file #read file line by line for line in lines: print (line) |
This script will print contents of file 'raw_corpus.txt' line by line.
No comments:
Post a Comment