Let's say the program will be run by typing by command line:
python3 program.py Downloads
Here is what I have so far.
import os
path = "Desktop" //how do I change path to the random user inputed directory provided by command line?
fname = []
for root,d_names,f_names in os.walk(path):
for f in f_names:
fname.append(os.path.join(root, f))
print("fname = %s" %fname)
Output:
fname = ['Desktop/Junk.odt']
I need to know how to find the largest file in the given directory and additionally print the filesize