473,412 Members | 2,067 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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.append(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.

--
http://mail.python.org/mailman/listinfo/python-list

--
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.

Jul 2 '08 #1
0 930

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jani Yusef | last post by:
Based on an interview question I heard of but did not know the answer to....... How do you find and remove a loop from a singly linked list? In a google groups search I found the following code...
4
by: Gen | last post by:
Hi - I'm a c# student, as a small class exercise we were asked to write a program that uses an Average function using the params keyword. My problem was with the loop, I could only get the Do...
2
by: Andrew Robinson | last post by:
I am working on a data access layer using a pattern that I see more and more. Define a class that is a data container that is then added to a generic List<>. I am then using this List and support...
0
by: Filemaxor | last post by:
I have gotten my code to be able to allow people to add new text to a .txt document and able to call up files so the user can see whats in it. The problem i'm having is getting the for loop to work...
2
by: msridhar87 | last post by:
hi, am doing a multi server chat program using select()..in the client side i need to multiplex thei/p from server and stdin. #include <stdio.h> #include <sys/types.h> #include <sys/socket.h>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.