[Tutor] (no subject)

Kirk Bailey highprimate@howlermonkey.net
Mon, 10 Dec 2001 1:54:0 -0500


Well, see, I am sneaking up on reading a text file which is a list of subscribers to a list.

The idea is to read it in, and store it in a list, with each line in that file a item in the list.
But I see what you mean. I should load it as several strings, not one long string. Loading it as one long 
string it fails to recognize the thing is many chunks of data, and treats it as one big chunk.

I am currently playing with a created file with some dummy accounts (all are real, and I own them all, so 
when i finally move to testing on live code, no one is going to yell at me).



At 12/9/01 10:40:00 PM, you wrote:
>At 06:35 PM 12/9/2001 -0500, Kirk Bailey wrote:
>>ok, in IDLE I created a variable, listnamemembers, and
>>inserted a bunch of info in it, with triple quotes.
>>listnamemembers = """me@here.net
>>you@there.org
>>Me@here2.com
>>everybody@earth.edu
>>nobody@domainerror.cc
>>"""
>
>Instead of making your data be one long character string,
>you might use a list with string elements:
>
>  >>> listmembers = ['me@here.net',
>                     'you@there.org',
>                     'Me@here2.com',
>                     'everybody@earth.edu',
>                     'nobody@domainerror.cc']
>  >>>
>  >>> for i in listmembers:  print i
>
>  me@here.net
>  you@there.org
>  Me@here2.com
>  everybody@earth.edu
>  nobody@domainerror.cc
>
>When you iterate over a list, you get its elements,
>whereas when you iterate over a string, you get each
>character, which is what was happening when you went
>the triple-quotes route.
>
>Kirby
>
>
>


end

In total confusion,
                   Kirk D Bailey

|----------------------------------------------------|
|           Consulting  Agent  Provecateur           |
|    Webmaster, Howlermonkey Email services Co.      |
|   Please visit us at http://www.howlermonkey.net/  |
|----------------------------------------------------|