
# https://www.globalsino.com/ICs/
# Find the largest file in the folder and subfolders.

import os
  
theFolder = r"C:\0Python\TestImages"
path = os.path.abspath(theFolder)
  
size = 0  
max_size = 0
max_file =""  
  
for folder, subfolders, files in os.walk(path):
    for file in files:
        size = os.stat(os.path.join( folder, file)).st_size
        if size>max_size:
            max_size = size
            max_file = os.path.join( folder, file  )

print("The largest file is: " + max_file, "in size of" + str(max_size)+ "bytes")
