I'm working with binary files that already contain "\n" as part of the data, but on a low-memory device that can't hold too much in memory. The "lines" are instead separated by "B5 62" (which is more unlikely to come up).
I know in standard python you can stick "newline=b'\xb5b'" at the end of the open() statement, is there a way to do this in micropython? No worries if not, would just save me a lot of work.
Custom newline characters when reading files
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Custom newline characters when reading files
It's unsupported. You'll have to read it as a binary file and parse it yourself, I'm afraid.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.