Hey guys,

I went with a combination of the above, though I tried several different
solutions. Here's what I ended up with:

def loadItem(self, objectToLoad):
    wordList = []
    fobj = open('/home/jason.conner/Documents/Python/objectconfig.txt', 'r')

    for line in fobj:
        if line == objectToLoad:
            wordList.append(line)
            for i in range(5):
                wordList.append(fobj.next())

Though it did take me a few minutes to figure out that I needed to include
the \n in the objectToLoad variable to get it to work in its present form,
it works great. Thanks for all your help!
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to