[CentralOH] 2013-04-11 道場

Eric Floehr eric at intellovations.com
Fri Apr 12 16:31:40 CEST 2013


> 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():
>         break
>

Not entirely sure of the context, but "best" for Python 2.4 and below might
be:

f = open('foo', 'rU')
for line in f:
    # Do whatever with line or pass
f.close()

And if you are using Python 2.5 or higher, this is "best", as it closes the
file always, even on an exception:

with open('foo', 'rU') as f:
    for line in f:
        # Do whatever with line or pass


better keyboards
> Model M13 Trackpoint II
> https://en.wikipedia.org/wiki/Model_M_keyboard
> https://en.wikipedia.org/wiki/Unicomp
> http://pckeyboard.com/page/category/EnduraPro
> https://en.wikipedia.org/wiki/ZF_Electronics#Cherry_switches
> https://en.wikipedia.org/wiki/Pointing_stick
> https://en.wikipedia.org/wiki/Happy_Hacking_Keyboard
>
> has bad feel:
> https://en.wikipedia.org/wiki/Optimus_Maximus_keyboard
>
> https://en.wikipedia.org/wiki/Sassafras



I am *very* pleased with my Leopold with Cherry MX Brown switches:
http://elitekeyboards.com/products.php?sub=leopold,tenkeyless&pid=fc200rtab

I got the one without the numpad (called a "tenkeyless" keyboard), which
keeps my mouse (Logitech Trackball) closer and my wrist bent less. The
combination of the keyboard (more tactile feedback, less typing pressure),
the closer mouse, and the trackball has nearly eliminated the carpal tunnel
symptoms I was having. The only negative at all on the keyboard is the
letters are painted on rather than etched, so they are fading a little bit
after a year of use (I'm a heavy user).

Cheers,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20130412/b7820f46/attachment-0001.html>


More information about the CentralOH mailing list