Memory Error while reading large file
![](https://secure.gravatar.com/avatar/7dc9afe419100d9335f70cc49614ce66.jpg?s=120&d=mm&r=g)
Hi I have a problem reading very large text file. When I call the len function to get the total lines in python file.i get memory error . I am reading the list of files in a loop ,2 files are read properly but when the third file is read , It gives an memory error . Sumant Gupta Software Engineer Ext:5105 ________________________________ "DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error,please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility forloss or damage arising from the use of the information transmitted by this email including damage from virus."
![](https://secure.gravatar.com/avatar/5615a372d9866f203a22b2c437527bbb.jpg?s=120&d=mm&r=g)
On Thu, 31 Jul 2008 03:01:42 pm Sumant Gupta wrote:
Hi
I have a problem reading very large text file. When I call the len function to get the total lines in python file.i get memory error . I am reading the list of files in a loop ,2 files are read properly but when the third file is read , It gives an memory error .
I'm not completely sure, but I think that means you're out of memory. If you have an actual question, I think you would be better off posting to the comp.lang.python newsgroup. This mailing list is for development of the Python compiler, not for writing Python programs. I'll save you some time: when you post to comp.lang.python, you should post the actual error message you get, and the code that fails. -- Steven
![](https://secure.gravatar.com/avatar/3acb8bae5a2b5a28f6fe522a4ea9b873.jpg?s=120&d=mm&r=g)
If you have an actual question
I'd like to stress this point as well. Any good posting one wants an answer to must include a question, and that question must be explicitly phrased, and terminated with a question mark. (maybe the use of the question mark is more typical in German than in English; my stomach turns around when I read a question that ends with a full stop) Regards, Martin
![](https://secure.gravatar.com/avatar/e5bc599ffbd6e6043182b3237e15ccaa.jpg?s=120&d=mm&r=g)
Martin v. Löwis wrote:
(maybe the use of the question mark is more typical in German than in English; my stomach turns around when I read a question that ends with a full stop)
There is no loss in translation here. Proper English requires the use of a question mark just the same as German, but you can't assume proper English will be used on a forum of communication like this one. The OP stated his problem, and maybe he doesn't know enough English to actually ask his question (I'm guessing by the name "Sumant Gupta"). I don't believe you are native speaker yourself, and I would've expected more sympathy from you. Lord knows I hope the recipients of any German I write will have some. -Scott -- Scott Dial scott@scottdial.com scodial@cs.indiana.edu
![](https://secure.gravatar.com/avatar/047f2332cde3730f1ed661eebb0c5686.jpg?s=120&d=mm&r=g)
On Thu, Jul 31, 2008 at 2:38 PM, Scott Dial <scott+python-dev@scottdial.com> wrote:
Martin v. Löwis wrote:
(maybe the use of the question mark is more typical in German than in English; my stomach turns around when I read a question that ends with a full stop)
There is no loss in translation here. Proper English requires the use of a question mark just the same as German, but you can't assume proper English will be used on a forum of communication like this one. The OP stated his problem, and maybe he doesn't know enough English to actually ask his question (I'm guessing by the name "Sumant Gupta"). I don't believe you are native speaker yourself, and I would've expected more sympathy from you. Lord knows I hope the recipients of any German I write will have some.
On the level of mercy: (a) this is python-dev, which is explicitly *not* for user questions; (b) the OP didn't show any actual code nor error messages, which makes it impossible to help him unless you're clairvoyant. Unfortunately we get quite a few of such ill-defined problems in this list, despite it not being the wrong list, and my own patience wears thin at times too. (I also get quite a bit of personal mail of the same nature.) -- --Guido van Rossum (home page: http://www.python.org/~guido/)
participants (6)
-
"Martin v. Löwis"
-
Greg Ewing
-
Guido van Rossum
-
Scott Dial
-
Steven D'Aprano
-
Sumant Gupta