import sys
import re

def findBestWildCardMatch(patterns):
    pass

def getRePattern(pattern):
    return re.sub(pattern, '\,', '/')

def findBestMatch(patterns, paths):
    result = []
    temp = []
    for path in paths:
        temp.clear()
...     for pattern in patterns:
            rePattern = getRePattern(pattern)
...         if re.findall(r'rePattern', path):
                temp.append(pattern)
        if len(temp) > 1:
            result.append(findBestWildCardMatch(temp))
        else if len(temp) == 0:
            result.append("NO MATCH FOUND")
        
    return result
    
#['foot', 'fell', 'fastest']
# Example to call this program: python34 patternMatch.py <input_file> output_file 
def main(args):
    input_file = open(args[1], 'r')
    output_file = open(args[2], 'w')
    
    pattern_list = []
    path_list = []
    
    N = input_file.readline()
    for j in range(N):
        pattern_list.append(input_file.readline())
    
    M = input_file.readline()
    for i in range(M):
        path_list.append(input_file.readline())
    
    print(findBestMatch(pattern_list, path_list))
    
    input_file.close()
    output_file.close()
    
if __name__ == '__main__':
    main(sys.argv)
    

@@ -238,19 +238,19 @@
 clear()%0A
-...
+   
      for
@@ -321,11 +321,11 @@
 rn)%0A
-...
+   
     
@@ -343,18 +343,16 @@
 findall(
-r'
 rePatter
@@ -352,17 +352,16 @@
 ePattern
-'
 , path):
@@ -493,11 +493,8 @@
   el
-se 
 if l
@@ -556,17 +556,9 @@
 D%22)%0A
-        
 %0A
+
     
@@ -571,21 +571,17 @@
  result%0A
-    
 %0A
+
 #%5B'foot'
@@ -682,17 +682,16 @@
 put_file
- 
 %0Adef mai
@@ -772,21 +772,17 @@
 %5D, 'w')%0A
-    
 %0A
+
     patt
@@ -814,21 +814,17 @@
 st = %5B%5D%0A
-    
 %0A
+
     N = 
@@ -915,29 +915,25 @@
 readline())%0A
-    
 %0A
+
     M = inpu
@@ -1021,21 +1021,17 @@
 line())%0A
-    
 %0A
+
     prin
@@ -1072,21 +1072,17 @@
 _list))%0A
-    
 %0A
+
     inpu
@@ -1120,21 +1120,17 @@
 close()%0A
-    
 %0A
+
 if __nam
@@ -1167,13 +1167,9 @@
 s.argv)%0A
-    
 %0A

Update patternMatch.py