Re: Help with Dictionaries and Classes requested please.

2007-08-10 Thread Alex Martelli
Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > special_dragonfly <[EMAIL PROTECTED]> wrote: > >if key in FieldsDictionary: > >FieldsDictionary[key].append(FieldClass(*line.split(","))) > >else: > >FieldsDictionary[key]=[FieldClass(*line.split(","))] > > These

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : > "Ben Finney" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "special_dragonfly" <[EMAIL PROTECTED]> writes: >> >>> I've managed to solve the problem, I really was just being a >>> dunce. >> Doubtful; but at this stage we can't tell, because we still

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Sion Arrowsmith
special_dragonfly <[EMAIL PROTECTED]> wrote: >if key in FieldsDictionary: >FieldsDictionary[key].append(FieldClass(*line.split(","))) >else: >FieldsDictionary[key]=[FieldClass(*line.split(","))] These four lines can be replaced by: FieldsDictionary.setdefau

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-08-09, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> Neil Cerutti a écrit : >>> On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote: Is there anyway for python to consider the values within a string when entering the data into a dictionary. I kn

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"Ben Finney" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "special_dragonfly" <[EMAIL PROTECTED]> writes: > >> I've managed to solve the problem, I really was just being a >> dunce. > > Doubtful; but at this stage we can't tell, because we still don't know > what it is you're act

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : > "Bruno Desthuilliers" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] >> special_dragonfly a écrit : >> (snip) (and resnip) > Hello > To answer first Bjoern: > I have a dictionary and a class. The dictionary needs to be filled with > multiple instances

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Neil Cerutti
On 2007-08-09, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Neil Cerutti a écrit : >> On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote: >>> Is there anyway for python to consider the values within a >>> string when entering the data into a dictionary. I know that >>> isn't very clear

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote: >> Is there anyway for python to consider the values within a >> string when entering the data into a dictionary. I know that >> isn't very clear so here's an example: >> >> class MyClass(object): >> def __init

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Ben Finney
"special_dragonfly" <[EMAIL PROTECTED]> writes: > I've managed to solve the problem, I really was just being a > dunce. Doubtful; but at this stage we can't tell, because we still don't know what it is you're actually trying to *do*. > Here's how incase anyone is wondering: > > class MyClass: >

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Neil Cerutti
On 2007-08-09, special_dragonfly <[EMAIL PROTECTED]> wrote: > Is there anyway for python to consider the values within a > string when entering the data into a dictionary. I know that > isn't very clear so here's an example: > > class MyClass(object): > def __init__(self,name="",age=""): >

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Steve Holden
special_dragonfly wrote: > "special_dragonfly" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Bruno Desthuilliers" <[EMAIL PROTECTED]> >> wrote in message news:[EMAIL PROTECTED] >>> special_dragonfly a écrit : >>> (snip) I've managed to solve the problem, I really was just

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"special_dragonfly" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Bruno Desthuilliers" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] >> special_dragonfly a écrit : >> (snip) >>> I've managed to solve the problem, I really was just being a dunce. >>> Here's how

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > special_dragonfly a écrit : > (snip) >> I've managed to solve the problem, I really was just being a dunce. >> Here's how incase anyone is wondering: >> >> class MyClass: >> def __init__(self): >> nam

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bruno Desthuilliers
special_dragonfly a écrit : (snip) > I've managed to solve the problem, I really was just being a dunce. Here's > how incase anyone is wondering: > > class MyClass: > def __init__(self): > name="" > dict={} > dict[0]=[] > dict[0].append(MyClass()) > dict[0][0].name="Hello" > print dic

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Bjoern Schliessmann
special_dragonfly wrote: > I've managed to solve the problem, I really was just being a > dunce. Here's how incase anyone is wondering: > > class MyClass: > def __init__(self): > name="" > dict={} > dict[0]=[] > dict[0].append(MyClass()) > dict[0][0].name="Hello" > print dict[0][0].na

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
"special_dragonfly" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > I'm new to this group, I've read through the subject of a lot of the group > but can't find anything relevant. Perhaps my question is too basic but I'm > still stuck. > Classes and Dictionaries. > If I have

Re: Help with Dictionaries and Classes requested please.

2007-08-09 Thread Peter Otten
special_dragonfly wrote: > I'm new to this group, I've read through the subject of a lot of the group > but can't find anything relevant. Perhaps my question is too basic but I'm > still stuck. > Classes and Dictionaries. > If I have a dictionary, how do I instantiate many instances of a class per

Help with Dictionaries and Classes requested please.

2007-08-09 Thread special_dragonfly
Hello, I'm new to this group, I've read through the subject of a lot of the group but can't find anything relevant. Perhaps my question is too basic but I'm still stuck. Classes and Dictionaries. If I have a dictionary, how do I instantiate many instances of a class per dictionary key? Either at ru