Re: How much memory used by a name

2007-02-15 Thread Fredrik Lundh
Bernard Lebel wrote: Bruno: good question. We're talking about text files that can have 300,000 lines, if not more. Currently, the way I have coded the file writing, every line calls for a write() to the file object, which in turns write to the text file. The file is on the network. assuming

Re: How much memory used by a name

2007-02-15 Thread Bart Ogryczak
On Feb 14, 9:41 pm, Bernard Lebel [EMAIL PROTECTED] wrote: This is taking a long time, and I'm looking for ways to speed up this process. I though that keeping the list in memory and dropping to the file at the very end could be a possible approach. It seems, that you're trying to reinvent

How much memory used by a name

2007-02-14 Thread Bernard Lebel
Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and toward the end, the file is

Re: How much memory used by a name

2007-02-14 Thread Diez B. Roggisch
Bernard Lebel wrote: Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and

Re: How much memory used by a name

2007-02-14 Thread Bruno Desthuilliers
Bernard Lebel a écrit : Hello, I would like to know if there is a way to know how much memory (bytes, kilobytes, megabytes, etc) a name is using. More specifically, I have this list of strings that I want to write to a file as lines. This list grows througout the script execution, and

Re: How much memory used by a name

2007-02-14 Thread Bernard Lebel
Diez: thanks, I will try that. However isn't sum() returning an integer that here would represent the number of elements? Bruno: good question. We're talking about text files that can have 300,000 lines, if not more. Currently, the way I have coded the file writing, every line calls for a

Re: How much memory used by a name

2007-02-14 Thread Bruno Desthuilliers
Bernard Lebel a écrit : Diez: thanks, I will try that. However isn't sum() returning an integer that here would represent the number of elements? Nope, it will return the sum of the length of the lines in the list. The long way to write it is: total = 0 for line in thelist: total +=

Re: How much memory used by a name

2007-02-14 Thread placid
On Feb 15, 11:08 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Bernard Lebel a écrit : Diez: thanks, I will try that. However isn't sum() returning an integer that here would represent the number of elements? Nope, it will return the sum of the length of the lines in the list. The long