En Mon, 14 May 2007 18:24:23 -0300, Stef Mientki
<[EMAIL PROTECTED]> escribió:
>>> files = os.listdir('D:\\akto_yk\\yk_controle\\*.txt')
>>>
>>> I get an error message
>>>
>>> WindowsError: [Errno 123] The filename, directory name, or volume
>>> label syntax is incorrect:
>>> 'D:\\akto_yk\\yk_controle\\*.txt/*.*'
> Still don't know why it's not allowed through listdir ;-)
Because listir expects a single directory as parameter, not a wildcard
specification.
That is, you could do:
files = os.listdir("D:\\akto_yk\\yk_controle")
to get ALL the filenames in that directory, and then filter them using
fnmatch. But that's exactly what the glob module does internally.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list