> 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
this code, which I'm happy with for several reasons:
def createaproposjlist(opname):
filelist=os.listdir('./icon.scripts/'+opname)
spltnames=map(os.path.splitext,filelist)
scripts=filter(lambda x: x[1]=='.script', spltnames)
filenames=map(''.join,scripts)
filebases=map(lambda x: x[0], spltnames)
return filebases;
Cheers,
Nandan
_______________________________________________
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor