Clean way to read a null-terminated (C-style) string from a file?
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Drifting Through My Dreams
--
Chapters
00:00 Question
02:28 Accepted answer (Score 6)
03:15 Thank you
--
Full question
https://stackoverflow.com/questions/3277...
Question links:
[a bit of rather ugly code]: http://bytes.com/topic/python/answers/41...
[universal newlines support]: https://docs.python.org/2/library/functi...
[struct]: https://docs.python.org/2/library/struct...
[doesn't look like it supports reading arbitrary-length C strings at all]: https://stackoverflow.com/q/26060110/398...
[ctypes]: https://docs.python.org/2/library/ctypes...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #string #null #python2x #cstrings
#avk47
    --
Music by Eric Matyas
https://www.soundimage.org
Track title: Drifting Through My Dreams
--
Chapters
00:00 Question
02:28 Accepted answer (Score 6)
03:15 Thank you
--
Full question
https://stackoverflow.com/questions/3277...
Question links:
[a bit of rather ugly code]: http://bytes.com/topic/python/answers/41...
[universal newlines support]: https://docs.python.org/2/library/functi...
[struct]: https://docs.python.org/2/library/struct...
[doesn't look like it supports reading arbitrary-length C strings at all]: https://stackoverflow.com/q/26060110/398...
[ctypes]: https://docs.python.org/2/library/ctypes...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #string #null #python2x #cstrings
#avk47