• This software is owned by The university of California, Irvine, and is not distributed under any version of the GPL. GPL is a fine series of licenses, but the owners of the software need it to be distributed under these terms.
  • Download here (preferably via SVN checkout: svn checkout https://stromberg.dnsalias.org/svn/readline0/trunk readline0).
  • readline0 is a python iterator that allows you to read data until a specific byte value is found - for example, you can do a readline that doesn't end with a newline, but rather with a null byte, or a "g" if you like - it's quite arbitrary. This is nice, EG, for reading filenames from GNU "find . -print0".
  • I've been using it in production for years.
  • It runs on Python 2.x and Python 3.x, including Pypy and Jython.
  • To get back byte strings instead of str's, pass in file_=0.
  • See also bufsock which can also read null terminated data, but is more about reserving the right to read in a variety of ways.
  • Example use (see the unit tests for more examples):


    Hits: 4350
    Timestamp: 2024-11-22 13:17:16 PST

    Back to Dan's tech tidbits

    You can e-mail the author with questions or comments: