Skip to content

Instantly share code, notes, and snippets.

@ivanhercaz
Last active January 16, 2020 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanhercaz/24ea9aacdd0e153af67481e02b58b1ad to your computer and use it in GitHub Desktop.
Save ivanhercaz/24ea9aacdd0e153af67481e02b58b1ad to your computer and use it in GitHub Desktop.
a small script to count files in subdirs and create a graph with Plotly (and then show it in a website created with Flask)
directories = [pages_dir for pages_dir in dirs if "pages" in pages_dir]
for directory in directories:
print(directory)
for subdir in next(os.walk(f"{directory}"))[1]:
print(subdir)
print(len(next(os.walk(f"{directory}/{subdir}"))[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment