Nick Stinemates wrote:
On Fri, Apr 25, 2008 at 09:50:56AM -0400, [EMAIL PROTECTED] wrote:
How about this?

for line in file:
    # ignore lines without = assignment
    if '=' in line:
        property, value = line.strip().split( '=', 1 )
        property = property.strip().lower()
        value = value.strip()

        # do something with property, value

Malcolm

This works until you have:
string=The sum of 2+2=4

Actually, it still works, because Malcolm used split()'s maxsplit parameter.

--
Carsten Haese
http://informixdb.sourceforge.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to