|
|
|
|
|
by ptx
1803 days ago
|
|
> I guess everyone else's reading-file-line-by-line loops in python are the epitome of creativity I would certainly hope not, since there is barely any code to write: for line in my_file: ...
For even more convenience in common cases, there is the fileinput module[1] in the standard library.I can see how a boilerplate-generating AI could be helpful in a more boilerplate-heavy language like Java, but a better solution is to use a language that better suits your usecase and lets you express it without the boilerplate. [1] https://docs.python.org/3/library/fileinput.html |
|