Malcolm Greene wrote:

> 2. Is there a technique for using glob.glob() to recognize files and
>    folders that begin with a period, eg. ".profile"? The documentation
>    states: "If the directory contains files starting with . they won’t
>    be matched by default.". Any suggestions on what the non-default
>    approach is to match these type of files?

I don't think there is a clean way. You can monkey-patch if you don't need 
the default behaviour elsewhere in your application:


$ touch foo .bar baz
$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob("*")
['foo', 'baz']
>>> glob._ishidden = lambda path: False
>>> glob.glob("*")
['.bar', 'foo', 'baz']


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

Reply via email to