4 ms·
Not that you can't do this in python: python -c "print '\n'.join(open('LICENSE.txt','r').read().split('\n')[:-10])" But this is besides the point.
by prolepunk 15y ago
Not that you can't do this in python:
python -c "print '\n'.join(open('LICENSE.txt','r').read().split('\n')[:-10])"
But this is besides the point.
- jodrellblank 15y agoYour split and join seem redundnant, and open defaults to read-only. print open('whatever.file').readlines()[:-10] But still, don't do that on any log too big to read into memory.