> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Are you sure this does what you want? You compute 'scripts' and 'filenames'
> and throw them away. I
> think this function will return the base name of all the files *and folders*
> in ./icon.scr
Are you sure this does what you want? You compute 'scripts' and 'filenames' and throw them away. I
think this function will return the base name of all the files *and folders* in ./icon.scripts/opname.
If you are trying to return the base name of every file or directory whose extension is '.scrip
> It does if you use the glob module :-)
>
> Python, with batteries included.
> But sometimes finding the right battery can be challenging...
>
Muttering 'globbing is a Perl concept, listing dirs must be in file ops' I
turned first to the Files section of the Nutshell book :-) But I came up with
t
> That is, filename globbing doesn't seem to work. Looks like I'll
have to
> use map/filter to do this. Is there a better way?
It does if you use the glob module :-)
Python, with batteries included.
But sometimes finding the right battery can be challenging...
Alan G.
>
> Thanks,
> N
>
> --
>
Have you looked at the glob module?
>>> import glob
>>> glob.glob('src/*.properties')
['src\\jdbc.properties', 'src\\jdbc_local.properties', 'src\\jdbc_qa.properties',
'src\\jdbc_test.properties', 'src\\log4j.jnlp.properties', 'src\\log4j.properties',
'src\\version.properties']
Kent
Nandan wrote
Hello
I need to get the equivalent of 'ls script.icons/*.script'
I looked around in the os module but can't find anything appropriate.
That is, filename globbing doesn't seem to work. Looks like I'll have to
use map/filter to do this. Is there a better way?
Thanks,
N
--
Nandan Bagchee
Patri