Dealing with files...

Gerhard Häring gh at ghaering.de
Sat Apr 26 01:44:45 CEST 2003


"lost" wrote:
> On Fri, 25 Apr 2003 22:51:12 +0000, Alex Martelli wrote: 
>>for each_file in os.dir('/var/path/to/files/'):
> 
> actually, not quite what i was looking for :)
> At this line, I get:
> AttributeError: 'module' object has no attribute 'dir'

The long answer is to read the docs for the os module.

The short answer is that Alex meant 'listdir'.

-- Gerhard





More information about the Python-list mailing list