I am trying to find a file
import os, fnmatch
path = "\\\\location1\\build1\\obj\\vendor\\qcom\\opensource\\tech"
def find(pattern, path):
result = 
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result = find('*.tech.so', path)
print result//prints empty string
Your match pattern is
*.tech.so, but the name you're looking for is
fnmatch patterns aren't the same as a regex, so
. only matches a literal
., not 'any single character' as it would in a regex.
*_tech.so as the pattern should work.