Jason Friedman wrote:
It's a shame that glob.glob does not take an arbitrary directory as an optional argument if one does not want to scan the current directory.

It doesn't have to -- you can give it an absolute path:

>>> from glob import glob
>>> glob("/usr/include/std*.h")
['/usr/include/stdarg.h', '/usr/include/stdbool.h', '/usr/include/stddef.h', '/usr/include/stdint.h', '/usr/include/stdio.h', '/usr/include/stdlib.h']

So just prepend the dir to the pattern and then
pass it to glob.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to