Created
February 10, 2014 12:40
-
-
Save miura/8915151 to your computer and use it in GitHub Desktop.
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
import os, re | |
def filterdirs(folderpath): | |
dirs = os.listdir(folderpath) | |
pattern = re.compile('(.*)-(.*)--(.*)') | |
dirlist = [] | |
for d in dirs: | |
if d.startswith('0'): | |
res = re.search(pattern, d) | |
#if int(res.group(1)) > 9 and int(res.group(1)) < 160: | |
if int(res.group(1)) < 160: | |
dirlist.append(d) | |
return sorted(dirlist) | |
folderpath = '/g/data/bio-it_centres_course/data/VSVG' | |
plates = filterdirs(folderpath) | |
print "plate number", len(plates) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment