Re: New meets old

Liste des GroupesRevenir à co vms 
Sujet : Re: New meets old
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 17. Jun 2025, 02:43:49
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <6850c855$0$684$14726298@news.sunsite.dk>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 6/16/2025 9:39 PM, Arne Vajhøj wrote:
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.
It is not really Python specific. Just a fun mix of new and old.
$ type deck3.com
$ cc/obj=z sys$input
#include <stdio.h>
int main()
{
     char line[100];
     while(gets(line)) puts(line);
     while(gets(line)) puts(line);
     return 0;
}
$
$ link z
$ run z
$ deck
A
B
$ eod
$ deck
C
D
$ eod
$ exit
$ @deck3
A
B
C
D
Arne

Date Sujet#  Auteur
16 Jun 25 * New meets old18Arne Vajhøj
17 Jun 25 `* Re: New meets old17Lawrence D'Oliveiro
17 Jun 25  `* Re: New meets old16Arne Vajhøj
17 Jun 25   +- Re: New meets old1Arne Vajhøj
17 Jun 25   `* Re: New meets old14Simon Clubley
17 Jun 25    +* Re: New meets old2Arne Vajhøj
1 Jul 25    i`- Re: New meets old1chrisq
17 Jun 25    +* Re: New meets old7jeffrey_dsi
19 Jun 25    i`* Re: New meets old6Simon Clubley
19 Jun 25    i `* Re: New meets old5Robert A. Brooks
19 Jun 25    i  +* Re: New meets old3Lawrence D'Oliveiro
20 Jun 25    i  i`* Re: New meets old2Robert A. Brooks
20 Jun 25    i  i `- Re: New meets old1abrsvc
2 Jul 25    i  `- Re: New meets old1Norbert Schönartz
17 Jun 25    +- Re: New meets old1Lawrence D'Oliveiro
18 Jun 25    `* Re: New meets old3Stephen Hoffman
18 Jun 25     +- Re: New meets old1Lawrence D'Oliveiro
18 Jun 25     `- Re: New meets old1bill

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal