newbie question
The1Eagle
the1eagle at aol.com
Fri Nov 2 00:48:21 EST 2001
Hello All,
I am trying to read in a file and place each word in the file into an array or
list so that those words can be manipulated (ie alphabetized, counted, deleted,
compared, etc). For some reason I can seem to find a way to get split to work
in this manner. Any ideas? Here is the code so far, but this may be the wrong
approach. Thanks.
#function that does all the work
def handledata(input):
text = input.readlines()
#need to parse text. Would be nice to have \n and other punctuation
removed.
#main routine
input = open("\\textfile.txt")
handledata(input)
More information about the Python-list
mailing list