Sujet : Re: New meets old
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 17. Jun 2025, 02:39:29
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <6850c752$0$684$14726298@news.sunsite.dk>
References : 1 2
User-Agent : Mozilla Thunderbird
On 6/16/2025 9:28 PM, Lawrence D'Oliveiro wrote:
On Mon, 16 Jun 2025 15:15:39 -0400, Arne Vajhøj wrote:
sys.stdout.writelines(sys.stdin.readlines())
sys.stdout.writelines(sys.stdin.readlines())
Some interesting semantics going on there. How do you continue reading
after encountering EOF? How does it reset the EOF condition to let you get
the second lot of data?
Normally, once an open file gets to EOF, it stays in that state until
fseek(2) (or equivalent) is called.
You put 3 decks of punched cards in the card reader.
One with the python program and two with data.
When it hit EOF on the first data deck then readlines()
stop, but the next readlines() start on the next data deck.
I did not know that it would work. But I tried and
it did work.
Arne