> On 17 May 2023, at 2:53 am, Paul Gilmartin > <0000042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote: > > On Tue, 16 May 2023 11:26:06 -0700, Michael Stein wrote: >> >> read can be supplied with an operand saying the maximum amount to >> read: read(4) to read 4 bytes. It might read less either because >> > So: "read_data = f.read( ntohs( SDW ) - 4 )"
There is no ntohs in Python. Network protocols are abstract in the libraries. The way to read/write binary data in different endians is to use the struct package https://docs.python.org/3/library/struct.html. > >> it reached the end of the input file or because the input is >> "interactive" (console? network?) and it just doesn't have any >> more right now. >> > I suppose there's some distinction between EAGAIN and EOF. > In REXX I have successfully (not necessarily usefully) switched > dynamically between blocking and non blocking and handled > EAGAIN. > > I don't know that REXX has SYSCALL SELECT. Does Python? > > -- > gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN