When using the glob import, I want it to scan all of the files in a directory, but not scan other directories in that directory. For example, say I am in a directory with the following files:
file, file1, file2, DIRECTORY1, DIRECTORY2
When I use the glob command:
os.chdir(element_directory) '''This is needed for the 'glob' import to understand where it is looking for the raw files''' file_list = glob.glob("*")
It returns the files, and the directories. Without adding some special extension to my files to avoid this situation, is there a way to tell the glob.glob command to avoid directories?