How to do this in Python?

Armin feng.shaun at gmail.com
Mon Mar 16 20:05:24 EDT 2009


On Tuesday 17 March 2009 19:10:20 Josh Holland wrote:
> On Tue, Mar 17, 2009 at 05:04:36PM -0500, Jim Garrison wrote:
> > What's the canonical Python way of implementing this pseudocode?
> >
> >     String buf
> >     File   f
> >     while ((buf=f.read(10000)).length() > 0)
> >     {
> >         do something....
> >     }
>
> That looks more like C than pseudocode to me...
> Someone's been spending far too much time on C-like languages, if that's
> what your idea of simply readable code looks like. Thank heavens you
> found Python before it was too late!

I should agree, that looks too much like C. (except there are no ; at the end 
of first two lines).  And I'm sure you will much enjoy your adventure as a 
pythonista (pythanista?) just as I have after migration from C++.

-- 
Armin Moradi



More information about the Python-list mailing list