detect if file or dir

Trent Mick trentm at ActiveState.com
Wed Jul 11 19:27:20 EDT 2001


On Wed, Jul 11, 2001 at 10:47:38PM +0000, pedro wrote:
> hi,
> 
> how can i detect if sth. is a file or a directory? exists(directory)
> does tell me if sth. is a directory but exits my script wenn it hits a
> file.

os.path.isdir(filename)
os.path.isfile(filename)


Cheers,
Trent

-- 
Trent Mick
TrentM at ActiveState.com




More information about the Python-list mailing list