reading file to list
xahlee at gmail.com
Sun Jan 18 09:31:15 CET 2009
On Jan 17, 10:25 am, Tino Wildenhain <t... at wildenhain.de> wrote:
> > [[int(x) for x in line.split()] for line in open("blob.txt")]
Nice (python code).
• the above code is borderline of atypical. e.g. it is not a average
python code would produce or one'd seen in corporate python code.
• voodoo like the above makes me dislike python. To me, the one
advantage of python is its clarity enforced by its syntax.
Specifically, the forced indendation and quite simple semantics.
However, the way i've seen Guido's propensities and how python 3 is
moving to, it is becoming more mumbo jumbo of computer sciency OOP
jargons with syntax soup. (with iterators, enumerators, list
comprehension... shits forced upon the users)
The above line illustrate well the ad hoc syntax soup nature python is
• Perl-Python Tutorial: List Comprehension
• Lambda in Python 3000
More information about the Python-list