Created
February 19, 2015 04:53
-
-
Save yramagicman/65e58134a8545bab407f to your computer and use it in GitHub Desktop.
List comprehensions ftw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files = os.walk(file_location) | |
def getNames(files): | |
filtered = [i for i in files if '.git' not in i[0]] | |
names = [] | |
for dirs in filtered: | |
names = names + [dirs[0] + '/' + d for d in dirs[2]] | |
return names | |
print getNames(files) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment