Hi,

I have a configuration file need to be processed (read/write) by python.
Currently I the following method can only read and store data that python read a line from a configuraiton file:
def _parse (self):
# parse message
m = self.FWShow_Command.match (conf_data)
if (m == None):
raise FW_Command.Error ("corrupt macro definition")


        # store generic data
        macro = {}
        macro["key"] = m.group (1)
        macro["value"] = m.group (2)

        return (conf_data, macro)

Since there are unknown number of lines in a configuration file, I want to store the array of "macro" in a list.
How can I do that in Python?


Thanks
Sam.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to