#!/usr/bin/env python3 F = open('asd.dat'); lines = F.readlines(); for i in lines: thisline = i.split(" "); word = ; for i in thisline: word.append(i.split(" ")) ; print("thisline",thisline); print("word", word); F.close()
However this just prints the words of the last line? is there a way by which i can get it to print all words?
eg if asd.txt has
This is python
Can i get the word to have [[hello], [people], [This], [is], [python]] ?
I would really appreciate your help!