Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 uid=99(nobody) gid=98(nobody) groups=98(nobody) Safe-mode: OFF (not secure) /opt/doc/python-2.3.4/html/Python-Docs-2.3.4/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 5.17 xreadlines -- Efficient iteration over a fileNew in version 2.1.
Deprecated since release 2.3.
Use
for line in file instead.
This module defines a new object type which can efficiently iterate
over the lines of a file. An xreadlines object is a sequence type
which implements simple in-order indexing beginning at Thus, the code
import xreadlines, sys
for line in xreadlines.xreadlines(sys.stdin):
pass
has approximately the same speed and memory consumption as
while 1:
lines = sys.stdin.readlines(8*1024)
if not lines: break
for line in lines:
pass
except the clarity of the for statement is retained in the former case.
An xreadlines object s supports the following sequence operation:
If successive values of i are not sequential starting from
After the last line of the file is read, this code will raise an IndexError. See About this document... for information on suggesting changes. |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.02 ]-- |