hi
i have script like this:
from fnmatch import fnmatch
from glob import glob
.....
....
f = ['file1','file2' ,'file3']
r = "d:\\somepa th"
pat = "*.bat"
listof_files = [i for i in f if not fnmatch(os.path .join(r,i),pat) and
os.path.isfile( os.path.join(r, i))]
....
...
I get this error:
File "C:\Python24\Li b\fnmatch.py", line 37, in fnmatch
pat = os.path.normcas e(pat)
File "C:\Python24\li b\ntpath.py", line 42, in normcase
return s.replace("/", "\\").lower ()
AttributeError: replace
But when i do everything in interactive, there is no problem.. What
could be wrong with the script?
My purpose is to find a list of files that does not match pat...
thanks
i have script like this:
from fnmatch import fnmatch
from glob import glob
.....
....
f = ['file1','file2' ,'file3']
r = "d:\\somepa th"
pat = "*.bat"
listof_files = [i for i in f if not fnmatch(os.path .join(r,i),pat) and
os.path.isfile( os.path.join(r, i))]
....
...
I get this error:
File "C:\Python24\Li b\fnmatch.py", line 37, in fnmatch
pat = os.path.normcas e(pat)
File "C:\Python24\li b\ntpath.py", line 42, in normcase
return s.replace("/", "\\").lower ()
AttributeError: replace
But when i do everything in interactive, there is no problem.. What
could be wrong with the script?
My purpose is to find a list of files that does not match pat...
thanks
Comment