[Tutor] Odd problem

Prospero prospero at prosperosisland.co.uk
Sat May 22 20:38:25 EDT 2004


Firstly, much thanks to those who responded to my last question. That enabled me to complete a program in Python that was going to take weeks to run in the language I had been using before. As far as I can tell from test runs it should complete in about two and a half hours in the Python version, which is obviously much better for me.

Now for the weird bit. Every time I try to run the thing it gets partway through and then my computer overheats and dies. (I am working on a laptop which is slightly temperamental but not usually that bad.) The best it has managed so far is about a fifth of the full task but there is no consistency to when it dies in terms of the percentage completed.

I therefore need to either slow the program down so that the machine can handle it or cut the task into chunks, of which the latter strikes me as the more practical approach. To do that I need it to save six integer values to a text file at the end of each run and then take those values as the starting point for the next run.

I cannot find anything in the Python documentation about how to read integers from a text file into a list. I assume there is a logical opposite to str() but have not seen it as yet. Any help would be much appreciated.

All the best,


"Everything that is really great and inspiring is created by the individual who can labor in freedom." -- Albert Einstein

Prospero's Island     http://www.prosperosisland.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040523/8d53b411/attachment.html

More information about the Tutor mailing list