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. ;) detai

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

2005-03-08 Thread Martin MOKREJŠ
Scott David Daniels wrote: Martin MOKREJŠ wrote: If I put them into a module, it get's executed only once unless I > do reload. And I'd have to use: "from some import *", because mainly I'm interrested in assigning to self: self.x = "blah" self.y =

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

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 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

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(): in

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 o

looking for way to include many times some .py code from another python code

2005-03-08 Thread Martin MOKREJŠ
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) def b(): include som

automating assignment of class variables

2005-03-02 Thread Martin MOKREJŠ
Hi, I need to build 3 classes for my work, but each have dozens or hundreds of variables, self bound. I have about 250 columns in about 10 mysql tables. I can squeeze everything into 10 classes, each representing single table. I happily utilize the argument checks when a class is instantiated, so t

ValueError: invalid literal for int(): 1.0000000000e+00

2005-02-14 Thread Martin MOKREJŠ
Hi, is this a bug or "feature" that I have to use float() to make int() autoconvert from it? $ python Python 2.3.4 (#1, Feb 14 2005, 10:00:27) [GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. a = 1 "%5.

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJŠ
Steve Holden wrote: Martin MOKREJŠ wrote: Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (a

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJŠ
Duncan Booth wrote: Martin MOKREJ© wrote: Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJŠ
Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered by vmstat) to push the data to dictionarie

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Paul Rubin wrote: Paul Rubin writes: handle with builtin Python operations without putting some thought into algorithms and data structures. From "ribosome" I'm guessing you're doing computational biology. If you're going to be writing Well, trying sort of ... Not much

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Simo Melenius wrote: "John Lenton" <[EMAIL PROTECTED]> writes: you probably want to look into building set-like objects ontop of tries, given the homogeneity of your language. You should see imrpovements both in size and speed. Ternary search trees give _much_ better space-efficiency compared to

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Adam DePrince wrote: On Mon, 2005-01-10 at 11:11, Martin MOKREJ¦ wrote: Hi, I have sets.Set() objects having up to 20E20 items, each is composed of up to 20 characters. Keeping them in memory on !GB machine put's me quickly into swap. I don't want to use dictionary approach, as I don't see a sense

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Robert Brewer wrote: Martin MOKREJŠ wrote: Robert Brewer wrote: Martin MOKREJŠ wrote: I have sets.Set() objects having up to 20E20 items, each is composed of up to 20 characters. Keeping them in memory on !GB machine put's me quickly into swap. I don't want to use dictionary approach,

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Robert Brewer wrote: Martin MOKREJŠ wrote: I have sets.Set() objects having up to 20E20 items, each is composed of up to 20 characters. Keeping them in memory on !GB machine put's me quickly into swap. I don't want to use dictionary approach, as I don't see a sense to store None

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Batista, Facundo wrote: [Martin MOKREJŠ] #- > At least you'll need a disk of 34694 EXABYTES!!! #- #- Hmm, you are right. So 20E15 then? I definitely need to be Right. Now you only need 355 PETABytes. Nowadays disk is cheap, but... #- in range 1-14. ;-) Why? I need to test for occuren

Re: Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Batista, Facundo wrote: [Martin MOKREJ?] #- I have sets.Set() objects having up to 20E20 items, #- each is composed of up to 20 characters. Keeping Are you really sure?? Either I'll have to construct them all over again say 20-30 times, or I'll find a way to keep them on disk. #- How can I wri

Writing huge Sets() to disk

2005-01-10 Thread Martin MOKREJŠ
Hi, I have sets.Set() objects having up to 20E20 items, each is composed of up to 20 characters. Keeping them in memory on !GB machine put's me quickly into swap. I don't want to use dictionary approach, as I don't see a sense to store None as a value. The items in a set are unique. How can I wri