Skip to content

Instantly share code, notes, and snippets.

@bryanbuchanan
Created March 10, 2018 00:41
Show Gist options
  • Select an option

  • Save bryanbuchanan/f79ce1d8efb152d5ed02a2a9f78a97a6 to your computer and use it in GitHub Desktop.

Select an option

Save bryanbuchanan/f79ce1d8efb152d5ed02a2a9f78a97a6 to your computer and use it in GitHub Desktop.
import os
import sys
directory = os.path.dirname(os.path.realpath(sys.argv[0]))
for dirpath, dirnames, files in os.walk(directory):
if not files:
os.rmdir(dirpath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment