The code
with open('workfile', encoding="utf-8") as f:
read_data = f.read()
is for reading text and you would normally be concerned with the character
count. Try
with open('workfile', "rb") as f:
read_data = f.read()
________________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of
Paul Gilmartin <[email protected]>
Sent: Tuesday, May 16, 2023 12:23 PM
To: [email protected]
Subject: Re: VBS file read in windows - end of record issue
On Tue, 16 May 2023 11:06:59 -0500, John McKown wrote:
>In one of my C programs, I first read the RDW, did a ntohs() to convert
>from mainframe to Intel integer, subtracted 4, then read that number of
>bytes into a char[32768].
>
I'm Python-naive. But trying to educate myself with the example,
<https://docs.python.org/3/tutorial/inputoutput.html>:
with open('workfile', encoding="utf-8") as f:
read_data = f.read()
... I see no explicit byte count. Is that implied, perhaps by a declaration
such as "char read_data[ LRECL ]"?
--
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN