Just for fun...
Not as brief as David's, nor as fun as Brian's, but lest we forget the
ease with wich we can abuse Java classes:
------------------------------------------------------
from java import io
class ff(io.FilenameFilter):
def accept(self, dir, name):
if name.lower()[-4:] == ".jar": return 1
L = io.File("/home/rbill").list( ff() )
print L
------------------------------------------------------
-Robert
On Thu, 25 Jan 2001, David Syer wrote:
>
>
> > -----Original Message-----
> > From: Naga Nunna [mailto:na...@lu...]
> > Sent: 25 January 2001 17:12
> > To: jpy...@py...
>
> > How do we do the equivalent of 'ls <path>/*.jar' in
> > JPython?
>
> $ from glob import glob
> $ glob('path/*.jar')
>
> _______________________________________________
> Jython-users mailing list
> Jyt...@li...
> http://lists.sourceforge.net/lists/listinfo/jython-users
>
|