[Tutor] os.path.exists(path) returns false when the path actually exists!

Bob Gailer bgailer at alum.rpi.edu
Tue Jul 31 03:45:13 CEST 2007

Iyer wrote:
>     Just to check, try to do away with the backslashes. Windows will
>     accept
>     a path with forward slashes just as well:
>     os.path.exists("c:/winnt/file_name")
> Nope, even, with the use of forward slashes in the path, it still 
> returns false
> What am I doing wrong here ?
Is there any chance the file has an extension that Windows is hiding?

Can you get True for other files in the folder?

Bob Gailer
510-978-4454 Oakland, CA
919-636-4239 Chapel Hill, NC

More information about the Tutor mailing list