QIO - Quick I/O module for Python (for fast reading)

QIO The QIO module borrows a few tricks from INN and adds some of its own to make common Python file operations way lots more faster and stuff. It is suitable for reading sockets and large text files; it doesn't support writing. Because of the read-ahead buffering, QIO will work best with sequential access. For compatibility's sake it will handle slurping a whole file in one read() and doing random access, but the optimizations can actually work against you in those cases. The readline*() methods include some enhancements over stock file objects: * You can specify a custom line terminator if '\n' isn't what you want. * Line terminators are optionally trimmed. (To find eof when trimming is enabled, you look for None instead of "") * A magic trim=2 argument makes quick work of "lines and dots" protocols like SMTP, NNTP and gopher, handling double-dots and CRLF shenanigans so you can use something like `message=s.readines()' to grab a mail message off the wire in one step To show how the trim=2 thingy works, a modified version of Python's nntplib.py is included. Since this module is derived from a piece of INN, it carries the same license (which is BSDish). See the package for details. Where to get it: Right here: http://members.xoom.com/_XOOM/meowing/python/index.html It's available in gzip'd tar form (21K) and as a ZIP file (19K). Documentation is included. <P><A HREF="http://members.xoom.com/_XOOM/meowing/python/index.html">QIO module</A> - faster version of <CODE>readline()</CODE> file operation (derived from INN news server code), with read-ahead buffering. (16-Sep-99) -- ----------- comp.lang.python.announce (moderated) ---------- Article Submission Address: python-announce@python.org Python Language Home Page: http://www.python.org/ Python Quick Help Index: http://www.python.org/Help.html ------------------------------------------------------------
participants (1)
-
Markus Fleck