def myMain( file_of_dirs ):
    """
    reads the file (name passed)
    visits each dir
    renames the files therein
    """
    try:
        #test whether the file passed exists, and the path is good
        if not os.path.exists( file_of_dirs ):
            raise NoFile("File does not exist")
        dname, fod_name = os.path.split (file_of_dirs )

        with open( file_of_dirs, 'r') as f:
            for fname in f:
                fname = fname.rstrip('\n')
                dir_to_walk = os.path.join(dname, fname)
                if not os.path.exists( dir_to_walk ):
                    print "Directory %s does not exist--can't process" % dir_to_walk
                else:
                    renameFilesInDir( dir_to_walk )
    except NoFile, err:
        print err.msg
    except:
       exc_info = sys.exc_info()
       print "unhandled exception in DirWalkRenameFile: %s %s %s" % (exc_info[0],exc_info[1],exc_info[2])

    reads the file (name passed)
    visits each dir
    renames the files therein
    
recipes/Python/576597_Directory_Walking_File_Renamer/recipe-576597.py