On 2/5/06, Bian Alex <[EMAIL PROTECTED]> wrote:
help <tutor@python.org>How can I get a string from a random file.For Example:Del ete On : Copy
Owner : Bn
Personalized: 5
PersonalizedName : My DocumentsI want to get the string after 'Owner' ( In example is 'Bn')'import re' ?Pls help.
You mean like this?
>>> line ='Owner:Bn'
>>> line = line.split(":")
>>> print line
['Owner', 'Bn']
>>> print line[1]
Bn
So you read the lines from the file till you find "Owner:Bn" and split it at the ':'.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor