#! /usr/bin/env python from useful import tokenize # Declare file to be worked with textfile = "furniture.txt" # Open file & read first line file = open(textfile,'r') line = file.readline() while line: line = line.rstrip() # tokenize the text: tokens = tokenize(line) print tokens line = file.readline() file.close()