How to get list of all sub directories and files along with their size ordered by size?
<p>How to get list of all sub directories and files along with their size ordered by size in ascending order?</p>

<p>The below code gets me the list of all files, but is not sorted according to size. Please help.</p>

<pre><code>import os
import os.path, time
from os.path import join, getsize
count=0
for root, dirs, files in os.walk('Test'):
    for file in list(files):
        fileaddress = os.path.join(root, file)
        print("\nName:",fileaddress)
        print("Time:",time.strftime("%m/%d/%Y %I:%M:%S %p",time.localtime(os.path.getmtime(fileaddress))))
        count=count+1
print(count);
</code></pre>
