Conversation started May 26, 2020 at 10:15.
MyWrathAcademia
May 26, 2020 10:15
@nwp When you use Python's òpen("file") as f:` what does calling the
read(12)
method like this do?
nwp
It reads up to 12 characters? This sounds like a trick question.
MyWrathAcademia
@nwp hmm, not a trick question. I thought may be it would read 12 bytes.
nwp
I think it defaults to text mode where it reads characters.
open("file", "rb")
should read bytes.
Mikhail
Isn't rb default?
nwp
The mode argument is optional;
'r'
will be assumed if it’s omitted.
MyWrathAcademia
May 26, 2020 10:30
@nwp that's very useful to know.
Conversation ended May 26, 2020 at 10:30.
all rooms
open("file", "rb") reads bytes
May '20
26
Lounge<C++>
Today we're daydreaming about C++26 reflection
5
context of the conversation
join this room
about this room
Participants
MyWrathAcademia
42%
nwp
42%
Mikhail
14%
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile