[Tutor] Re: Files and such

Prospero prospero at prosperosisland.co.uk
Thu Sep 30 18:45:00 CEST 2004


Greetings!

Still hoping someone can give me an answer on this. (Problem repeated below.) It
seems such an obvious thing but neither the online information I have seen nor
the one book I own on Python seem to address it.

I need to save some numbers in a text file. This bit I can do no problem but
then I need a different part of the program to read these numbers one set at a
time, starting at the beginning and stopping at the end. For preference the file
should be plain text so that I can amend it by hand if necessary. Any clues
about how to do this would be much appreciated.

The numbers are in groups of six, all single- or double-digit integers. The file
would be added to one group at a time. The image I have in mind is of each group
occupying one line, separated either by commas or spaces, but this does not
matter as long as the format is clear enough to allow human editing.

All the best,

Prospero.




More information about the Tutor mailing list