Re: looking for way to include many times some .py code from anotherpython code

2005-03-09 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Steve Holden wrote: [...] I will be *very* surprised if you can't get a much better (i.e. easier and more efficient) solution by stepping back from the programming Hmm, I'm not convinced, but I'll put few more words here then. ;) details for a moment an

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Brian Roberts
> > Am I so deperately fighting the language? No-one here on the list needs to > set hundreds > variables at once somewhere in their code? I still don't get why: > I once (and only once) needed hundreds of variables in a program. It was to simplify creation of unit tests, not for production us

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steve Holden
Martin MOKREJŠ wrote: Steve Holden wrote: [...] I will be *very* surprised if you can't get a much better (i.e. easier and more efficient) solution by stepping back from the programming Hmm, I'm not convinced, but I'll put few more words here then. ;) details for a moment and explaining what it

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Peter Hansen
Martin MOKREJŠ wrote: I need to test almost every for it's content. Some tests are just that the value is non-empty (few cases), but in most cases a lot more checks (only certain values allowed, or only int type allowed, or only \w is allowed ...). This sounds very much like an opportunity for some

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steve Holden
Martin MOKREJŠ wrote: Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies wanting to access th

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Peter Hansen wrote: Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies wanting to access them distinctly, not as

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Peter Hansen
Martin MOKREJŠ wrote: Am I so deperately fighting the language? No-one here on the list needs to set hundreds variables at once somewhere in their code? Nobody needs to do that. As others have pointed out, creating variables implies wanting to access them distinctly, not as a whole group. If yo

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steven Bethard
Martin MOKREJŠ wrote: The data passed to an instance come from sql tables. I have the idea every table will be represented by an object. Have you looked at SQLObject? I've never used it, but it does seem like this is the sort of thing it was designed for: http://sqlobject.org/ STeVe -- http://ma

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Hi to everyone who has repsonded. I'll try to clarify my problem in more detail. I believe I have the answers how to assign to self. in superclasses. In case you would know of yet another way, let me know. ;) Steve Holden wrote: Martin MOKREJŠ wrote: Diez B. Roggisch wrote: See my post on Mar 2 abo

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Steve Holden
Martin MOKREJŠ wrote: Diez B. Roggisch wrote: See my post on Mar 2 about "automating assignment of class variables". I got no answers, maybe I wasn't clear enough ... :( Seems so - I for example didn't understand it. I need to define lots of variables. The variable names are often identical. The

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Duncan Booth
Martin MOKREJŠ wrote: > Am I so deperately fighting the language? No-one here on the list > needs to set hundreds variables at once somewhere in their code? I > still don't get why: I've certainly never needed to set hundreds of variables at once in my code. I might have hundreds of values, but

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Diez B. Roggisch wrote: See my post on Mar 2 about "automating assignment of class variables". I got no answers, maybe I wasn't clear enough ... :( Seems so - I for example didn't understand it. I need to define lots of variables. The variable names are often identical. The problem is that if I p

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Kent Johnson wrote: Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9 cat somefile2.py self.xxx = a self.zzz = b self.c = c self.d = d cat anotherfile.py def a(): include somefile

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Diez B. Roggisch
> See my post on Mar 2 about "automating assignment of class variables". > I got no answers, maybe I wasn't clear enough ... :( Seems so - I for example didn't understand it. > > I need to define lots of variables. The variable names are often > identical. The problem is that if I put such a cod

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Martin MOKREJŠ
Scott David Daniels wrote: Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: I know about module imports and reloads, but am not sure if this is the right way to go. Mainly, I want to assign to multiple object

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Kent Johnson
Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: cat somefile.py a = 222 b = 111 c = 9 cat somefile2.py self.xxx = a self.zzz = b self.c = c self.d = d cat anotherfile.py def a(): include somefile postprocess(a) d

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Scott David Daniels
Martin MOKREJŠ wrote: Hi, I'm looking for some easy way to do something like include in c or PHP. Imagine I would like to have: I know about module imports and reloads, but am not sure if this is the right way to go. Mainly, I want to assign to multiple object instances some self bound v