<div dir="auto"><div>Dnes je ještě lepší toto:</div><div dir="auto">with open('data.txt') as f:</div><div dir="auto"> for line in f:</div><div dir="auto"> print line<br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">Dne 31. 3. 2017 13:35 napsal uživatel "Petr Přikryl" <<a href="mailto:prikryl@atlas.cz">prikryl@atlas.cz</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Roman Miklos napsal(a):<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Radsej by som naopak uvital keby sa preberalo stale viac, napriklad keby<br>
bolo mozne namiesto<br>
<br>
f = open("data.txt")<br>
line = f.readline() while line:<br>
print line<br>
line = f.readline()<br>
f.close()<br>
<br>
napisat jednoducho ako v Perle a C++<br>
<br>
f = open("data.txt")<br>
while line = f.readline():<br>
print line f.close()<br>
</blockquote>
<br>
Já raději píšu<br>
<br>
f = open("data.txt")<br>
for line in f:<br>
print line<br>
f.close()<br>
<br>
<br>
pepr<br>
______________________________<wbr>_________________<br>
Python mailing list<br>
<a href="mailto:python@py.cz" target="_blank">python@py.cz</a><br>
<a href="http://www.py.cz/mailman/listinfo/python" rel="noreferrer" target="_blank">http://www.py.cz/mailman/listi<wbr>nfo/python</a><br>
<br>
Visit: <a href="http://www.py.cz" rel="noreferrer" target="_blank">http://www.py.cz</a><br>
</blockquote></div><br></div></div></div>