[EMAIL PROTECTED] a écrit :
> First I want to say thanks everyone for helping me!
>
> John Machin wrote:
>
>
>>[EMAIL PROTECTED] wrote:
>>
>>>I want to make an addressbook and I'm new to OO programming, so I
>>>wonder if this sounds reasonable.
>>>
>>>I think of making a class Address which cont
On 1 Jan 2007 17:09:19 -0800,
[EMAIL PROTECTED] wrote:
> Lets say I have those two classes, Person and Address. How would one
> implement the relationship between them? First, a Person can have one
> or more addresses (or none), that could be represented as a list of
> Addresses, right? But then,
Steven D'Aprano wrote:
> On Sun, 31 Dec 2006 22:00:58 -0800, Paddy wrote:
>
> >> def save(self, filename):
> >> self.currentfile = file(filename, "w")
> >> for address in self.addresses:
> >> self.save_one_address(address.export())
> >> self.currentfile.clos
On Jan 1, 8:09 pm, [EMAIL PROTECTED] wrote:
> Lets say I have those two classes, Person and Address. How would one
> implement the relationship between them? First, a Person can have one
> or more addresses (or none), that could be represented as a list of
> Addresses, right? But then, if I have an
First I want to say thanks everyone for helping me!
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> > I want to make an addressbook and I'm new to OO programming, so I
> > wonder if this sounds reasonable.
> >
> > I think of making a class Address which contains all data about one
> > person, tha
[EMAIL PROTECTED] wrote:
> If I want to save all addresses to disk, I can have a method, say,
> save() of AddressBook. But then what? What is a good object oriented
> approach? Should each Address object take care of saving itself to the
> file, with a method like writetofile(filename), or should t
On Sun, 31 Dec 2006 22:00:58 -0800, Paddy wrote:
>> def save(self, filename):
>> self.currentfile = file(filename, "w")
>> for address in self.addresses:
>> self.save_one_address(address.export())
>> self.currentfile.close()
>> self.currentfile = Non
[EMAIL PROTECTED] wrote:
> I want to make an addressbook and I'm new to OO programming, so I
> wonder if this sounds reasonable.
>
> I think of making a class Address which contains all data about one
> person, that class can have UserDict as baseclass so I can access data
> like object['name'], et
Steven D'Aprano wrote:
> On Sun, 31 Dec 2006 19:47:12 -0800, fejkadress wrote:
>
> > I want to make an addressbook and I'm new to OO programming, so I
> > wonder if this sounds reasonable.
> >
> > I think of making a class Address which contains all data about one
> > person, that class can have
[EMAIL PROTECTED] wrote:
> I want to make an addressbook and I'm new to OO programming, so I
> wonder if this sounds reasonable.
>
> I think of making a class Address which contains all data about one
> person, that class can have UserDict as baseclass so I can access data
In Python 2.4 or 2.5 yo
On Sun, 31 Dec 2006 19:47:12 -0800, fejkadress wrote:
> I want to make an addressbook and I'm new to OO programming, so I
> wonder if this sounds reasonable.
>
> I think of making a class Address which contains all data about one
> person, that class can have UserDict as baseclass so I can access
I want to make an addressbook and I'm new to OO programming, so I
wonder if this sounds reasonable.
I think of making a class Address which contains all data about one
person, that class can have UserDict as baseclass so I can access data
like object['name'], etc..
Then maybe I can have a class Ad
In article <[EMAIL PROTECTED]>,
Jeremy Winters <[EMAIL PROTECTED]> wrote:
from SegmentValue import *
I remember in the old days a computing support guy saying he refused to
help any users with FORTRAN questions unless they had an "IMPLICIT NONE"
in every program block.
The corresponding
Jeremy Winters wrote:
> class SegmentValue:
> def
> __init__(self,seg=[0,0,0,0,0,0],value=0,description=""):
> self.segment=seg
> self.value=value
> self.description=description
>
> #that's my class! note the default of a 6 item list
> for the seg pa
Jeremy Winters napisal(a):
> class SegmentValue:
> def
> __init__(self,seg=[0,0,0,0,0,0],value=0,description=""):
> self.segment=seg
> self.value=value
> self.description=description
>
> #that's my class! note the default of a 6 item list
> for the s
class SegmentValue:
def
__init__(self,seg=[0,0,0,0,0,0],value=0,description=""):
self.segment=seg
self.value=value
self.description=description
#that's my class! note the default of a 6 item list
for the seg parameter... which is then bound(?
16 matches
Mail list logo