Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mct
on Sept 28, 2013
|
parent
|
context
|
favorite
| on:
Don’t Slurp: How to Read Files in Python
If you're writing a filter, an even better pattern is:
while (<>) { ... }
By omitting the file handle, "<>" will go line by line through each filename specified on the command line. If no filename arguments were passed, it reads from STDIN.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: