How to detect the presence of a html file

Phoe6 orsenthil at gmail.com
Fri Dec 9 14:25:16 EST 2005


Kent Johnson wrote:
> The problem is that \ is special in string literals. \b is a backspace
> character, not the two-character sequence you expect. \w has no special
> meaning so it *is* the two-character sequence you expect.

> The simplest fix is to use raw strings for all your Windows path needs:
> os.path.isfile(r'c:\bookmarks.html')
> os.path.isfile(r'c:\wumpus.c')

Thanks a lot, Kent!
I immediately recognized the problem from your reply.
I am just starting with python. :) 

Thanks again!

Regards,
Senthil




More information about the Python-list mailing list