Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-24 Thread Colin J. Williams
On 22-Jun-10 08:03 AM, Jerry Rocteur wrote: On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: If you were able to ask us perhaps a more specific question and describe your problem a little more concisely perhaps I (and we) might have a bit more to offer you. I have a dictionary: users[key

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 13:56:43 +0200 (CEST) "Jerry Rocteur" wrote: > As part of learning Python, I'm also learning OOP! That is why I want > to know if this is doable using classes. Everything[1] is doable using classes. The question is: Do you *need* to do it with classes? If your problem is best

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Dave Angel
Jerry Rocteur wrote: On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: If you were able to ask us perhaps a more specific question and describe your problem a little more concisely perhaps I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user'

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jean-Michel Pichavant
Jerry Rocteur wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/22/2010 01:32 PM, Jerry Rocteur wrote: My input is NOT CSV, I used this format to try and make the question shorter. Although I could create a CSV file, I'd like to learn how to code a class to work the way I describ

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
On 06/22/2010 02:03 PM, Jerry Rocteur wrote: >> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: >> If you were able to ask us perhaps a more specific question >> and describe your problem a little more concisely perhaps >> I (and we) might have a bit more to offer you. > > I have a dictiona

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 10:03 PM, Jerry Rocteur wrote: >> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: >> If you were able to ask us perhaps a more specific question >> and describe your problem a little more concisely perhaps >> I (and we) might have a bit more to offer you. > > I have

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Bruno Desthuilliers
Jerry Rocteur a écrit : (snip) As part of learning Python, I'm also learning OOP! That is why I want to know if this is doable using classes. > The input is not important, I end up with the dictionary as described in the question and as I asked in the question, I'd like to access the dictiona

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 10:03 PM, Jerry Rocteur wrote: > How do I iterate through and access an individual user record! A much better question! :) You are in fact already demonstrating that you know full well how to access a specific user record - by accessing a parent dictionary holding a mappi

Re: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 9:56 PM, Jerry Rocteur wrote: > As part of learning Python, I'm also learning OOP! That is why I want to know > if this is doable using classes. > > The input is not important, I end up with the dictionary as described in the > question and as I asked in the question, > I

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/22/2010 01:32 PM, Jerry Rocteur wrote: >> My input is NOT CSV, I used this format to try and make the question >> shorter. Although I could create a CSV file, >> I'd >> like to learn how to code a class to work the way I described in the

Re: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > My input is NOT CSV, I used this format to try and make the question shorter. > Although I could create a CSV file, I'd > like to learn how to code a class to work the way I described in the question. Your input certainly looks CSV-ish to m

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/22/2010 01:32 PM, Jerry Rocteur wrote: > My input is NOT CSV, I used this format to try and make the question shorter. > Although I could create a CSV file, I'd > like to learn how to code a class to work the way I described in the question. So

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On 06/22/2010 12:05 PM, Jerry Rocteur wrote: >> Sorry for the long mail but I've been searching the web for days for how to >> do this.. I see that possibilities using >> shelve or pickle but I don't want to do this (The source of the data changes >> constantly) > > You might be interested in t

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
On 06/22/2010 12:05 PM, Jerry Rocteur wrote: > Sorry for the long mail but I've been searching the web for days for how to > do this.. I see that possibilities using > shelve or pickle but I don't want to do this (The source of the data changes > constantly) You might be interested in the csv mo

From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
Hi, Sorry for the long mail but I've been searching the web for days for how to do this.. I see that possibilities using shelve or pickle but I don't want to do this (The source of the data changes constantly) I'm learning Python and very much a beginner with Classes. I have data like this: (h