How to use glob() output as input to os.listdir()
Assuming you have a string to pass into glob that does wildcard matching, glob will return a list of matches. So you don't need to make a string out of that list and replace the square-brackets and so on. You can just iterate over that list and do something with each of the values, which are already strings.

results = glob.glob(your_pattern)


Based on your code, the results is actually a list of folder names for which you want to count the number of files in each. We can loop over results and print the counts:

for folder in results:
    n = len(os.listdir(folder))
    print("Folder: {0} --&gt; \t {1} files".format(folder, n))