Skip to content

Instantly share code, notes, and snippets.

@SpiralOutDotEu
Created October 21, 2019 17:52
Show Gist options
  • Select an option

  • Save SpiralOutDotEu/21383538f330d80e4f068874b177a297 to your computer and use it in GitHub Desktop.

Select an option

Save SpiralOutDotEu/21383538f330d80e4f068874b177a297 to your computer and use it in GitHub Desktop.
import os
def get_files(folder):
for item in os.listdir(folder):
full_item = os.path.join(folder, item)
if os.path.isfile(full_item):
yield full_item
elif os.path.isdir(full_item):
yield from get_files(full_item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment