[Tutor] log parsing

Will Harris mosinu at gmail.com
Wed Nov 30 16:20:35 CET 2005


Cool, thanks Kent.

On 11/29/05, Kent Johnson <kent37 at tds.net> wrote:
>
> Will Harris wrote:
> > I am trying to work out doing a bit of log parsing in python. Below is
> > the code I have gotten so far, It works in an earlier version of this
> > one but this one doesn't print out the lines in my log files. Does
> > anyone see anything that I am missing here or can just point me in the
> > direction to look?
> >
> >     for logs in sys.argv[1:]:
> >       open(logs)
> >       for line in logs:
>
> This should be something like
>   f = open(logs)
>   for line in f:
>
> You are opening the file and throwing it away, then iterating over the
> command line argument.
>
> Kent
>
> --
> http://www.kentsjohnson.com
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051130/45ca631b/attachment.html


More information about the Tutor mailing list