[CentralOH] 2013-04-11 道場
kurtis.mullins at gmail.com
Fri Apr 12 16:38:24 CEST 2013
Wouldn't it be more correct to do this?
# Do something
1. It's more likely that each line will have data; therefore, make that the
first (priority) condition
2. Logically thinking, you assume your file has data. You only break in the
case that it doesn't have data, which is probably going to be last (EOF).
So the procedural code would be organized accordingly.
Just my $0.02.
Judging by the other information you have in this email, I'm assuming this
was just an over-view from a meeting you guys had :) So my apologies if
this is the wrong place for that discussion.
On Fri, Apr 12, 2013 at 10:16 AM, <jep200404 at columbus.rr.com> wrote:
> f = open('foo', 'rU')
> while True:
> # if f.readline() == '': # bad style
> # if not len(f.readline()): # bad style
> # if len(f.readline()) == 0: # bad style
> if not f.readline():
> if not seq:
> if seq:
> if len(seq):
> if not len(seq):
> if seq == '':
> CSV module is great
> file.readline() returns empty string at EOF.
> better keyboards
> Model M13 Trackpoint II
> has bad feel:
> CentralOH mailing list
> CentralOH at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CentralOH