On 2/5/06, Bian Alex <[EMAIL PROTECTED]> wrote:
How can I get a string from a random file.
For Example:
Del    ete On   :   Copy
Owner   :  Bn
Personalized: 5
PersonalizedName        :          My    Documents
 
I want to get the string after 'Owner' ( In example is 'Bn')
 
'import re' ?
 
Pls help.
help <tutor@python.org>

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

Reply via email to