so i have a os.walk code
search = self.search.get_text()
top = '/home/bludiescript/tv-shows'
for dirpath, dirnames, filenames in os.walk(top):
for filename in filenames:
if fnmatch.fnmatch(filename, search)
print os.path.join([dirpath, filename])
on python docs it shows you can match any seq of chars with [seq] pattern but no matter how i try to implement that it give so kind of error or no results at all.
so what would be the correct implementation to match the seq of cars in search so it will print out the file or files that match
implementations i tried
if fnmatch.fnmatch(filename, [search]) error i got was typeerror unhasable type : 'list'
if fnmatch.fnmatch[filename, search] error i got was typeerror fnmatch function is not subscriptable
if fnmatch.fnmatch([filename, search]) error typeerror fnmatch takes two arguments 1 given
if fnmatch.fnmatch([filename], search) error typeerror expected string or buffer
if fnmatch.fnmatch([search], filename) error typeerror expected string or buffer
if fnmatch.fnmatch(filename, search, [seq]) error nameerror global name seq not defined
if fnmatch.fnmatch(filename, '[search]')
no errors but did not produce any results
search values
hello, mkv, merry 1, 2, 3, 4, 5, 6, 7, etc...