Simple ini Config parser examples needed

2008-12-02 Thread RON BRENNAN
Hello, I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? Thanks, Ron-- http://mail.python.org/mailman/listinfo/python-list

Multimapping and string converting

2008-09-19 Thread Ron Brennan
Hello, I have a multimap dictionary with a 1 Key to N values. I want to convert the N values to a string to be used elsewhere in my program. So I have dict[(1,[1, 2 ,3 ,4])] which I have sorted When I do a print ''.join(str(dict.value())) I get [1, 2, 3, 4] as an output when I really want 1 2 3

Configuration Parsers

2008-09-17 Thread Ron Brennan
Hello, I am trying to parse a shared config file which doesn't contail section headers. Is there a way I can still use ConfigParser()? If not what is a widely used parser available? Thanks, Ron -- http://mail.python.org/mailman/listinfo/python-list

Multipart - Counting the amount of Values for One key

2008-08-29 Thread Ron Brennan
hello, I am trying to find the amount of values there are pertaining to one key. For example: - To find the average of the values pertaining to the key. - Use the amount of values to calculate a histogram Also, how do reference a specific value for a key in a multipart? Thanks, Ron -- FYI,

Re: Multiple values for one key

2008-08-28 Thread Ron Brennan
>> Terry Reedy wrote: >> >>> >>> >>> Ron Brennan wrote: >>> >>>> Hello, >>>> How would I create a dictionary that contains multiple values for one >>>> key. >>>> >>> >>> Make the value

Multiple values for one key

2008-08-27 Thread Ron Brennan
Hello, How would I create a dictionary that contains multiple values for one key. I'd also like the key to be able to have duplicate entries. Thanks, Ron -- FYI, my email address is changing. My rogers account will be deactivated shortly. From now on please use: [EMAIL PROTECTED] -- http://ma

Sorting an array on the nth element in a list

2008-08-20 Thread Ron Brennan
Hello, I am trying to parse a log file. I want to sort based on the second element the list that is in the file. What is the best way to do this? The sort is just on the line itself where I want to re-organize the lines based on the second element of the csv file Thanks, Ron -- http://mail.pyt