Albert Hopkins wrote:
I don't know about "easier", but a more elegant way is to not use os.popen() and to use Python's functions os.path.getsize (or os.stat) and os.walk (or os.path.walk) to achieve this. In fact if you look at the docstring for os.walk there is an example that almost does what you're doing with du, but is cross-platform and not dependent on shelling a process and scraping its stdout.
Thanks Albert, I'll take a look, Esmail -- http://mail.python.org/mailman/listinfo/python-list