Newbie Question: Regular Expressions

Volucris volucris at hotmail.com
Thu Jul 12 14:23:56 EDT 2001


I'm not too confortable with with regular expressions, so I can't help you
there. But, I did write a program for my father that might help you out a
little bit. It downloads winning Powerball numbers (It's a lottery if you
didn't know.) and grabs the numbers for a chosen date.
PBallAgent: http://volucris.8m.com/PBallAgent/pballagent.pyw.txt

--

Volucris (a) hotmail.com
"Eu não falo uma única palavra do português."

<fett at tradersdata.com> wrote in message
news:mailman.994953021.32263.python-list at python.org...
> I have a really dumb program that i would like to make smarter.  I need
> to take a file on my hard drive and filter out everything except for the
> standings which are written in it.  I have tried to use regular
> expressions with no success, but i still think that they are probably
> the best way.  I created the following simple fix, but it is unreliable
> if the data changed posistions.
>
>
> input = open('rawdata', 'r')
> S = input.read()
> print S[4021:6095]
>
> Output :
>    League Standings
>    American League
>      EAST W L PCT GB HOME ROAD EAST CENT WEST NL L10 STRK
>      Red Sox 43 29 .597 - 23-15 20-14 23-13 8-7 6-6 6-3 6-4 L2
>      Yankees 41 31 .569 2.0 21-15 20-16 19-11 12-9 5-7 5-4 6-3 W2
>      Blue Jays 35 38 .479 8.5 18-20 17-18 14-13 6-7 11-13 4-5 5-5 W3
>      Orioles 34 39 .466 9.5 20-20 14-19 15-17 9-12 6-5 4-5 5-5 L1
> ........( it continues with all the standings)
>
>
> Also could you tell me if its possible to download the data from the
> web-page in python so that it doesnt even have to deal with opening the
> file.
>
>
>
>
>
>
>
> --
> Daniel Hammond              Get your free e-mail account today @
> Raleigh NC                     http://sabacctable.zzn.com
> The United States of America
> -------------------------------------------------------------------
>
>
>





More information about the Python-list mailing list