I have a directory contains 50 files I want to read them one by one and compare wit the other files - that is fixed. I am using glob.blob. But it didn't work. 
Here how I am reading all files. Instead, path = '*.rbd' if I give the file name like path = run-01.rbd it works. 
path = '*.rbd'
path = folder + path
files=sorted(glob.glob(path))
complete code
import glob
from itertools import islice
import linecache
num_lines_nonbram =  1891427
bits_perline = 32
total_bit_flips =  0
num_bit_diff_flip_zero = 0
num_bit_diff_flip_ones = 0
folder = "files/"
path = '*.rbd'
path = folder + path
files=sorted(glob.glob(path))
original=open('files/mull-original-readback.rbd','r')
#source1 = open(file1, "r")
for filename in files:
 del_lines = 101
 with open(filename,'r') as f:
  i=1
  while i <= del_lines:
   line1 = f.readline()
   lineoriginal=original.readline()
   i+=1
  i=0  
  num_bit_diff_flip_zero = 0
  num_bit_diff_flip_ones = 0
  num_lines_diff =0
  i=0
  j=0
  k=0
  a_write2 = ""
  while i < (num_lines_nonbram-del_lines):
        line1 = f.readline() 
        lineoriginal = original.readline() 
        while k < bits_perline:
                if ((lineoriginal[k] == line1[k])):
                     a_write2 += " "
                else:
                     if (lineoriginal[k]=="0"): 
                     #if ((line1[k]=="0" and line1[k]=="1")):
                      num_bit_diff_flip_zero += 1
                     if (lineoriginal[k]=="1"): 
                     #if ((line1[k]=="0" and line1[k]=="1")):
                      num_bit_diff_flip_ones += 1
                     #if ((line1[k]==1 and line1[k]==0)):
                      #a_write_file2 = str(i+1) + " " + str(31-k) + "\n" + a_write_file2
                      #a_write2 += "^"
                      #num_bit_diff_flip_one += 1
                   # else:
                    #    a_write2 += " " 
                k+=1
                total_bit_flips=num_bit_diff_flip_zero+num_bit_diff_flip_ones
        i+=1
        k=0
i = 0
print files
print "Number of bits flip zero= %d" %num_bit_diff_flip_zero +"\n" +"Number of bits flip one= %d" %num_bit_diff_flip_ones +"\n" "Total bit flips = %d " %total_bit_flips
f.close()
original.close()
 
     
    