[sage-support] Re: Reading numbers from a file

2009-06-05 Thread Nicolas
It is no question of format... simply the line length which can be megabytes.. But Burcin pointed out the solution : http://stackoverflow.com/questions/417703/python-c-like-stream-input One suggestion, though, wouldn't you feel this should be readily available from sage ? Or at list some

[sage-support] Re: Reading numbers from a file

2009-06-04 Thread Craig Citro
In short, anyone knows a simple trick provided by sage or python to read numbers from a file without redoing the parsing stuff ? Luckily, both python's float type and Sage's RealDoubleField (or any of the RealFields) are smart enough to convert from strings: [craigci...@sharma ~/temp] $ cat

[sage-support] Re: Reading numbers from a file

2009-06-04 Thread Craig Citro
This is almost what I want to do. I had figured out that trick but my problem is that the line that is input is, in my case, really long and gulps a lot of memory. Thus, to save memory, I need to read the numbers one by one (or a small bunch of them at a time). It seems I have to read line

[sage-support] Re: Reading numbers from a file

2009-06-04 Thread Nicolas
This is almost what I want to do. I had figured out that trick but my problem is that the line that is input is, in my case, really long and gulps a lot of memory. Thus, to save memory, I need to read the numbers one by one (or a small bunch of them at a time). It seems I have to read line by

[sage-support] Re: Reading numbers from a file

2009-06-04 Thread Burcin Erocal
On Thu, 4 Jun 2009 01:21:06 -0700 (PDT) Nicolas nicolas.fresseng...@gmail.com wrote: This is almost what I want to do. I had figured out that trick but my problem is that the line that is input is, in my case, really long and gulps a lot of memory. Thus, to save memory, I need to read