I want to loop through files in a directory (I get that working easily) but skip files in subdirectories (I don't get this working).
How would I achieve this? Currently I use this:
for subdir, dirs, files in os.walk(scriptdir1):
for file in files:
if os.path.isfile(scriptdir + file):
with open(file, "rb") as f:
dbx.files_upload(f.read(), "/" + file, mode=dropbox.files.WriteMode.overwrite)
This is what my folder looks like (This could change so I don't want any folder specific answers):
So I want to loop through the files in this directory, and skip the files that are in subdirectories. I only want the files that are in THIS directory.
Thanks