Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
RiderOfGiraffes
on Feb 22, 2010
|
parent
|
context
|
favorite
| on:
The Non-Programming Programmer
It's also wrong - "readlines" keeps the "\n", and you've added another one between lines.
Luyt
on Feb 22, 2010
[–]
Indeed. A cosmetic refinement, but it should really be:
python -c "print ''.join(reversed(list(open('test.py'))))"
That's even two characters less!
spudlyo
on Feb 22, 2010
|
parent
[–]
Good, but too easy. Assume you can't keep the file in memory.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: