Message103173
| Author |
george.hu |
| Recipients |
eric.smith, george.hu, l0nwlf |
| Date |
2010年04月15日.01:40:19 |
| SpamBayes Score |
2.903191e-08 |
| Marked as misclassified |
No |
| Message-id |
<s2i3c0ab30d1004141840w882783d5x8794c5a9261fd436@mail.gmail.com> |
| In-reply-to |
<1271295276.54.0.998986003184.issue8402@psf.upfronthosting.co.za> |
| Content |
Well, the listdir doesn't support "wildcard", for example,
listdir("*.app"). I know the glob is kind of unix shell style expanding, but
my program is running under windows, it's my tiny script to walk through a
huge directory in my NAS. And there are many directories named with "[]" and
"()" characters amid. May the only way is to program a filter on the
listdir.
On Wed, Apr 14, 2010 at 6:34 PM, Shashwat Anand <report@bugs.python.org>wrote:
>
> Shashwat Anand <anand.shashwat@gmail.com> added the comment:
>
> glob module does not provide what you want.
> As a workaround you can try:
>
> os.listdir("c:\abc\afolderwith[test]")
>
> 07:02:52 l0nwlf-MBP:Desktop $ ls -R test\[123\]/
> 1 2 3
> >>> os.listdir('/Users/l0nwlf/Desktop/test[123]')
> ['1', '2', '3']
>
> Changing type to 'Feature Request'
>
> ----------
> status: pending -> open
> type: behavior -> feature request
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue8402>
> _______________________________________
> |
| Files |
| File name |
Uploaded |
|
unnamed
|
george.hu,
2010年04月15日.01:40:18
|
|