I need to get list of files which directory contains, but not only filename, but list of full paths to the file. Like in archive I can do:
tar = tarfile.open(directory, "r:gz")
directory_to_get_stuff_from = [member.name for member in tar.getmembers()]
directory_to_get_stuff_from = os.listdir(directory)
You could use
os.path.join in order to get absolute filenames:
[os.path.join(directory, f) for f in os.listdir(directory)]
os.listdirdoesn't recursively look for files in subfolders.
os.listdirreturns files as well as directories inside directory.
os.walkif you need more functionality.