[Tutor] If os.path.lexists() isn't working properly

Alan Gauld alan.gauld at btinternet.com
Wed Nov 24 20:30:03 CET 2010

"Susana Iraiis Delgado Rodriguez" <susana.delgado_s at utzmg.edu.mx> 

> I'm writing a python script to validate if files with extension .prj 
> exist,
> if they exist it should write 1 or 0 into an excel cell. I've 
> working to do
> this properly, but I'm not getting the results I need. The script 
> doesn't
> find all the files, is like the files don't exist but they exist, 
> besides I
> think is just reading some of the files that are in C:\Python 26. I 
> really
> need a hand on this.

I haven't checked the code thoroughly but it looks like you should
maybe put in a print statement to print the root to check it is going
where you think it should.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list