[Tutor] rf1

Kirk Bailey deliberatus@my995internet.com
Tue, 04 Dec 2001 00:50:46 -0500


ok, got a copy of a letter zi sent to myself. capturex it in my server,
emailed it to meself from in there, here it is below. also wrote this
script.

----rf1 # = ReadFile program #1---------
import string

f = open("letter2.TXT",r')
in1=f.readlines()
f.close()

print in1
--------------EOF---------------
ok, now for giggles, here is that letter.
------------The VERY next line is it's first.-----------------
>From deliberatus@my995internet.com Tue Dec  4 00:13:16 2001
Return-Path: <deliberatus@my995internet.com>
Received: from my995internet.com ([64.78.133.184])
        by ns.howlermonkey.net (8.11.1/8.11.0) with ESMTP id
fB45DAS59756
        for <testcode@howlermonkey.net>; Tue, 4 Dec 2001 00:13:16 -0500
(EST)
        (envelope-from deliberatus@my995internet.com)
Received: from my995internet.com [63.17.249.117] by my995internet.com
with ESMTP
  (SMTPD32-6.06) id A5533CA000F6; Mon, 03 Dec 2001 21:47:15 -0700

Message-ID: <3C0C5B40.6466E49B@my995internet.com>
Date: Tue, 04 Dec 2001 00:12:32 -0500

From: Kirk Bailey <deliberatus@my995internet.com>
Organization: Silas Dent Memorial Cabal of ERIS Esoteric and hot dog
boiling society 
 so there.
X-Mailer: Mozilla 4.74 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: testcode@howlermonkey.net
Subject: test
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

test-first body line
-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/


last body line
---------------------previous line was the last line of the
file--------------

ok, this earned me some intresting output:

print in1


C:\Python21>python rf1
['From deliberatus@my995internet.com Tue Dec  4 00:13:16 2001\n',
'Return-Path:
<deliberatus@my995internet.com>\n', 'Received: from my995internet.com
([64.78.13
3.184])\n', '        by ns.howlermonkey.net (8.11.1/8.11.0) with ESMTP
id fB45DA
S59756\n', '        for <testcode@howlermonkey.net>; Tue, 4 Dec 2001
00:13:16 -0
500 (EST)\n', '        (envelope-from deliberatus@my995internet.com)\n',
'Receiv
ed: from my995internet.com [63.17.249.117] by my995internet.com with
ESMTP\n', '
  (SMTPD32-6.06) id A5533CA000F6; Mon, 03 Dec 2001 21:47:15 -0700\n',
'\n', 'Mes
sage-ID: <3C0C5B40.6466E49B@my995internet.com>\n', 'Date: Tue, 04 Dec
2001 00:12
:32 -0500\n', '\n', 'From: Kirk Bailey
<deliberatus@my995internet.com>\n', 'Orga
nization: Silas Dent Memorial Cabal of ERIS Esoteric and hot dog boiling
society
 \n', ' so there.\n', 'X-Mailer: Mozilla 4.74 [en] (Win98; U)\n',
'X-Accept-Lang
uage: en\n', 'MIME-Version: 1.0\n', 'To: testcode@howlermonkey.net\n',
'Subject:
 test\n', 'Content-Type: text/plain; charset=us-ascii\n',
'Content-Transfer-Enco
ding: 7bit\n', '\n', 'test-first body line\n', '-- \n',
'Respectfully,\n', '
         -Kirk D Bailey (C)2001\n', '              Addme! icq
#27840081\n', 'end
\n', '\n', '\n', 'Within the sweep of his sword, Each man is an
Ubar.\n', '\n',
'http://www.howlermonkey.net/\n', 'http://www.sacredelectron.org/\n',
'\n', '\n'
, 'last body line\n']

C:\Python21>

Looks like it formed a tupple if I grok this right.

But I wanted a dictionary! They are SO much easier to search!






-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/