Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
with open('xxx.txt') as f:
|
||||
for i, line in enumerate(f):
|
||||
if i == 6:
|
||||
break
|
||||
else:
|
||||
print('Not 7 lines in file')
|
||||
line = None
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from itertools import islice
|
||||
|
||||
with open('xxx.txt') as f:
|
||||
try:
|
||||
line = next(islice(f, 6, 7))
|
||||
except StopIteration:
|
||||
print('Not 7 lines in file')
|
||||
|
|
@ -0,0 +1 @@
|
|||
print open('xxx.txt').readlines()[:7][-1]
|
||||
Loading…
Add table
Add a link
Reference in a new issue