If I have a text file like this:
Hello World How are you? Bye World
How would I read it into a multidimensional array like this:
Also don't forget to use strip to remove the \n:
strip
\n
myArray = [] textFile = open("textFile.txt") lines = textFile.readlines() for line in lines: myArray.append(line.split(" "))