Iteration through a text file.

kuntzagk at sulawesi.bioinf.mdc-berlin.de kuntzagk at sulawesi.bioinf.mdc-berlin.de
Thu Jun 5 06:55:44 EDT 2003


On Wed, 04 Jun 2003 11:01:05 +0000, marcus wrote:
[Code snipped]
> I know the code is flawed, and it appears that line just keeps
> incrementing from where it left off (which I thought was good), and I
> think that makes sense to me.
> 
> What I want to know is how do I point line back to the area it started
> the inner loop with?
> 
> After Seeing the first "Server" and finding no availability, how do I
> go to the next "Server?"

Why don't you just read the whole file into _one_ string and split it at
every occurence of 'Server'? 
Now you can search the splitet string for servername and availability.

Murple




More information about the Python-list mailing list