documentation on read.encode

Larry Martell larry.martell at gmail.com
Tue Jan 16 14:52:21 EST 2018


On Tue, Jan 16, 2018 at 2:35 PM, Gene Heskett <gheskett at shentel.net> wrote:
> On Tuesday 16 January 2018 14:19:38 Larry Martell wrote:
>
>> On Tue, Jan 16, 2018 at 12:00 PM, Larry Martell
> <larry.martell at gmail.com> wrote:
>> > Looking for 2.7 docs on read.encode - googling did not turn up
>> > anything.
>> >
>> > Specifically, looking for the supported options for base64, and how
>> > to specify them, e.g. Base64.NO_WRAP
>>
>> So I just realized that encode() is not a method of read() it's a
>> string method. But I still have the same question - can I pass in any
>> flags?
>>
>> My issue is that I am base64 encoding PNG images on linux and it's
>> putting a LF at the end of each line. If I do the same on Windows it's
>> putting CR/LF. I want the files to be encoded with no platform
>> dependences. Googling I found mention of Base64.NO_WRAP and I want to
>> pass that into encode() - can I do that?
>
> Di you not have the manpages installed?
>
> In my copy of the manpage:
> base64 [OPTION]... [FILE]
> where option is:
>  -w, --wrap=COLS
>               wrap encoded lines after COLS character (default 76).  Use
> 0 to disable line wrapping.
>
> Seems pretty simple.

But how do I use that in read().encode('base64')?



More information about the Python-list mailing list