glob and directory

too at pk.highway.ne.jp too at pk.highway.ne.jp
Tue Jul 27 02:54:54 EDT 1999


Hello.

I would like each output of "glob.glob()" to be
added "/"
if returned value is directory.

That is...

>>> import glob
>>> print glob.glob('*')
['file1', 'file2', 'file3', 'dir1', 'dir2']

===> ['file1', 'file2', 'file3', 'dir1/', 'dir2/'] 

Is it possible ?

If not, is there any way to determine
if the given name is directory or not ?

Thanks for reading.

Thooney Millennier.




More information about the Python-list mailing list