[Tutor] Simple

G Kiran goki75 at vsnl.net
Mon Sep 15 15:53:59 EDT 2003


Is it possible for these mailing list digests to stick to a format..
this is a request 'coz i parse these mail messages to keep as a
ref guide.

using the following script

import os
dr=os.listdir("c:\\docume~1\\kkk\Desktop\\py")
f2=open("c:\\summary.txt","w")
for i in range(len(dr)):
    d=dr[i]
    f=open('c:\\pymail\\'+d,'r')
    print d
    s=f.read()
    f.close()
    i=s.find('Date:')
    dt=s[i:i+22]
    i=s.find("Today's Topics:")
    j=s.find("Message",i,len(s))
    tpcs=s[i:j]
    f2.write(dt+"\n")
    f2.write(tpcs+"\n\n\n");
f2.close


and every time u change the format i need to change the program..it has some
kind of o//p like this


Date: Wed, 06 Aug 2003
Today's Topics:

   1. RE: floating point accuracy (Alan Trautman)
   2. Re: sys.path (Lee Harr)
   3. RE: floating point accuracy  [working with Fractions] (Danny Yoo)
   4. Options - Format -  "String with no terminator" - bgcolor
(RASTM2 at aol.com)
   5. Re: what's a state machine? (Alan Gauld)
   6. Re: Graphical object browser? (Alan Gauld)
   7. Re: How to get messages from stderr (Michael Lange)
   8. Re: why use *get* (A.M. Kuchling)
   9. python22 (Seyed Fard)
  10. outputting dictionary key/value pairs (Terence Lo)
  11. Re: Mutable String Question (Roeland Rengelink)
  12. Re: Regular Expression guru saught (A.M. Kuchling)
  13. Re: Comments wanted on new Python introduction (A.M. Kuchling)

--__--__--




Date: Wed, 06 Aug 2003
Today's Topics:

   1. Re: python22 (Alan Gauld)
   2. Re: what's a state machine? (pcarey at lexmark.com)
   3. Re: python22 (Lee Harr)
   4. Re: what's a state machine? (Alan Gauld)
   5. Re: what's a state machine? (Alan Gauld)
   6. Re: Executing an executable with commandline options (Lee Harr)
   7. Re: python22 (Bob Gailer)
   8. Re: outputting dictionary key/value pairs (Cliff Wells)
   9. Sockets, again (Jonathan Hayward http://JonathansCorner.com)
  10. Re: what's a state machine? (R. Alan Monroe)
  11. Re: what's a state machine? (Jeff Shannon)


----------------------------------------------------------------------




Date: Thu, 07 Aug 2003
Today's Topics:

   1. Re: python22 (Todd Stephens)
   2. Re: what's a state machine? (Alan Gauld)
   3. Re: outputting dictionary key/value pairs (Terry Carroll)
   4. Re: outputting dictionary key/value pairs (Zak Arntson)
   5. Re: Re: Using a dictionary to keep a count (Karl Pfl?sterer )
   6. Re: Graphical object browser? (Terry Carroll)
   7. wiki project update (Kirk Bailey)
   8. 2 functions- are they state machines? (Kirk Bailey)
   9. RE: floating point accuracy (Stephen Ng)
  10. Re: Regular Expression guru saught (Magnus Lyck?)


----------------------------------------------------------------------


as you can see the topic seperator till 6 aug was --__--__--
and then it changed
o  --------------------------------------------------------

yes i can write a generalised one with re and python/perl
but guess i cud keep it simple...

-kiran



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 8/12/2003




More information about the Tutor mailing list