Subject: Re: [Tutor] os.listdir fn

2004-12-12 Thread Nandan
> 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

Re: [Tutor] os.listdir fn

2004-12-11 Thread Kent Johnson
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

Re: [Tutor] os.listdir fn

2004-12-10 Thread Nandan
> 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

Re: [Tutor] os.listdir fn

2004-12-10 Thread Alan Gauld
> 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 > > -- >

Re: [Tutor] os.listdir fn

2004-12-10 Thread Kent Johnson
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

[Tutor] os.listdir fn

2004-12-10 Thread Nandan
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