Re: [Tutor] loops to assign variables

2006-07-26 Thread Alan Gauld
I'm reading the gmane news archive to see what I missed while on vacation and noticed this. Sorry the response is so late... "John CORRY" <[EMAIL PROTECTED]> wrote > For example, I have 30 textentry boxes numbered from entry20 to > entry50. > I have used the following code to assign the entrybox

Re: [Tutor] loops to assign variables

2006-07-23 Thread Alan Gauld
I've been on vacation so missed the start of this, apologies if i'm missing a point somewhere but... > Ah. I see. A copy, eh? Or, at least a new dictionary separate > from the "real" namespace. OK. I don't know why locals() returns > a copy as opposed to the original, What else can it do? W

Re: [Tutor] loops to assign variables

2006-07-22 Thread Dave Kuhlman
On Sat, Jul 22, 2006 at 01:41:17PM -0400, Kent Johnson wrote: > Dave Kuhlman wrote: [snip] > > And, also, that's why the following statements all have exactly > > the same effect: > > > > total = 5 > > locals()['total'] = 5 > > exec('total = 5') > > You're not in the mood to believe

Re: [Tutor] loops to assign variables

2006-07-22 Thread Kent Johnson
Dave Kuhlman wrote: > On Sat, Jul 22, 2006 at 11:37:38AM -0400, Python wrote: > >> >> Well the reference documentation says: >> >> locals( >> ) >> Update and return a dictionary representing the current local >> symbol table. Warning: The contents of this dictionary should >>

Re: [Tutor] loops to assign variables

2006-07-22 Thread Dave Kuhlman
On Sat, Jul 22, 2006 at 11:37:38AM -0400, Python wrote: > On Sat, 2006-07-22 at 17:18 +0200, Karl Pflästerer wrote: > > On 22 Jul 2006, [EMAIL PROTECTED] wrote: > > > > > > > > On Sat, 2006-07-22 at 14:11 +0100, John CORRY wrote: > > >> Hi, > > >> > > >> I am refactoring my code. I am trying to

Re: [Tutor] loops to assign variables

2006-07-22 Thread Python
On Sat, 2006-07-22 at 17:18 +0200, Karl Pflästerer wrote: > On 22 Jul 2006, [EMAIL PROTECTED] wrote: > > > > > On Sat, 2006-07-22 at 14:11 +0100, John CORRY wrote: > >> Hi, > >> > >> I am refactoring my code. I am trying to reduce the amount of lines > >> by using more loops. I tend to use cop

Re: [Tutor] loops to assign variables

2006-07-22 Thread Karl Pflästerer
On 22 Jul 2006, [EMAIL PROTECTED] wrote: > > On Sat, 2006-07-22 at 14:11 +0100, John CORRY wrote: >> Hi, >> >> I am refactoring my code. I am trying to reduce the amount of lines >> by using more loops. I tend to use copy and paste a lot instead of >> writing a loop to do the work. >> >> For

Re: [Tutor] loops to assign variables

2006-07-22 Thread Python
On Sat, 2006-07-22 at 14:11 +0100, John CORRY wrote: > Hi, > > I am refactoring my code. I am trying to reduce the amount of lines > by using more loops. I tend to use copy and paste a lot instead of > writing a loop to do the work. > > For example, I have 30 textentry boxes numbered from ent

[Tutor] loops to assign variables

2006-07-22 Thread John CORRY
Hi,   I am refactoring my code.  I am trying to reduce the amount of lines by using more loops.  I tend to use copy and paste a lot instead of writing a loop to do the work.   For example, I have 30 textentry boxes numbered from entry20 to entry50.  I have used the following code to ass