Re: Problem with a for loop and a list

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexnb

    Re: Problem with a for loop and a list


    Actually I tried that and had no sucsess, but I just figured it out. I set
    every value in wordList to 'None' and so even if all the entry fields aren't
    taken up, they go to '', so I can tell what is and what isn't taken up, and
    get the string of the ones that are taken up.


    Terry Reedy wrote:
    >
    >
    >
    Alexnb wrote:
    >I am not sure what is going on here. Here is the code that is being run:
    >>
    >def getWords(self):
    > self.n=0
    > for entry in self.listBuffer :
    > self.wordList[self.n] = entry.get()
    >
    And what does self.wordList begin as? If {}, then the assignemt is
    invalid. Perhaps you want self.wordList.a ppend(entry.get ())
    >
    > self.n=self.n+1
    >
    Is this supposed to be incremented once per entry or once per
    getWords()? If the former, you would overwrite previous assignment (if
    it worked) for every item except the last.
    >
    --

    >
    >
    --
    View this message in context: http://www.nabble.com/Problem-with-a...p18232688.html
    Sent from the Python - python-list mailing list archive at Nabble.com.

Working...