Very stupid question.
peter at engcorp.com
Thu Mar 30 20:39:40 CEST 2006
On 3/30/06, *Sullivan Zheng* <sullivanz.pku at gmail.com
<mailto:sullivanz.pku at gmail.com>> wrote:
> Wow, seems I am not that supid. Why python does not include this
> function in the file object. It is almost a tradition in other
> import os
> really not elegant or OO.
You might find something like Jason Orendorff's path.py module (Google
for it) to be more elegant. With it, this works fine:
>>> from path import path
(But note that it's just a nice wrapper around the scattered builtin
ways of doing the same thing, in this case the os.stat().st_size
approach mentioned above. That's not a bad thing, though, IMHO.)
More information about the Python-list