http://docs.python.org/library/stdtypes.html -> File Objects. Andreas On 21.09.09 08:40, Matthias Huening wrote:
Hallo,
gibt es eigentlich einen prinzipiellen Unterschied zwischen:
(a) for zeile in open(datei): tu_was()
und:
(b) with open(datei) as f: for zeile in f: tu_was()
Ist eine der beiden Möglichkeiten schneller, besser, schöner? Wenn ja, warum?
Schöne Grüße, Matthias
_______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
-- ZOPYX Ltd. & Co KG \ ZOPYX & Friends Charlottenstr. 37/1 \ The experts for your Python, Zope and D-72070 Tübingen \ Plone projects www.zopyx.com, info@zopyx.com \ www.zopyx.de/friends, friends@zopyx.de ------------------------------------------------------------------------ E-Publishing, Python, Zope & Plone development, Consulting