31 ms·
You'll get an IndexError exception on that if there are any blank lines in the file. Changing that to line.lstrip().startswith('#') would be an alternate appro
by chrisheller 12y ago
You'll get an IndexError exception on that if there are any blank lines in the file.
Changing that to line.lstrip().startswith('#') would be an alternate approach.
- exDM69 12y agoYou're right but that is irrelevant, it's a somewhat contrived example anyway. It's not like I spent a lot of time trying it out.