eeck. Not that I advocate parsing files by line, but if you need to do it:
lines = list(file)[16:] or lines_iter = iter(file) zip(lines_iter, xrange(16)) for line in lines_iter: Andreas Am Montag, den 21.04.2008, 14:42 +0000 schrieb linuxian iandsd: > Another horrid solution > > #!/usr/bin/python > # line number does not change so we use that > # the data we're looking for does not have a (unique) close > tag (htmllib ????) > > import re, urllib2 > file=urllib2.urlopen('http://10.1.2.201/server-status') > n=0 > for line in file: > n=n+1 > if n==16: > print re.sub('requests.*','',line)[4:].strip() > elif n==17: > print re.sub('requests.*','',line)[4:].strip() >
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor