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
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
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
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
"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
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
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
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
"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:
>
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=""):
>
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
"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
"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
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
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
"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
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
17 matches
Mail list logo