On 2011-03-18, JSkinn3 <skinner_1...@hotmail.com> wrote: > I'm new to python and I am trying to figure out how to remove all sub > directories from a parent directory using a wildcard. For example, > remove all sub directory folders that contain the word "PEMA" from the > parent directory "C:\Data". > > I've trying to use os.walk with glob, but I'm not sure if this is the > right path to take.
I see you've got 2 suggestions allready. Wichever you use, please note you need to begin the search from the bottom of the tree. The call to os.walk should include a False value for the direction of the walk: os.walk("c:/data", False). -- When in doubt, use brute force. -- Ken Thompson -- http://mail.python.org/mailman/listinfo/python-list