Jul-11-2021, 08:34 AM
I am not an expert, but this works for me:
split any path on '.' a file will give a resulting list of len(resultlist) = 2
If you can split the path, it is a file or a ./ a hidden directory
split any path on '.' a file will give a resulting list of len(resultlist) = 2
If you can split the path, it is a file or a ./ a hidden directory
path = '/home/pedro/summer2021/OMR/' files = glob.glob(path + '**', recursive=True) for f in files: # shows all paths and files in path print(f) uploads = [] for f in files: # if the path leads to a file, it will contain a . # problem is if there are hidden directories with naked pictures of your gf I think if len(f.split('.')) == 2: # you found a path with an ending .something uploads.append(f)Then upload everything in uploads.