Re: How to detect the presence of a html file

2005-12-10 Thread Tim Roberts
Irmen de Jong <[EMAIL PROTECTED]> wrote: >BartlebyScrivener wrote: >>> Even weirder, >> >>> os.path.isfile(r'c://bookmarks.html') >> >> Never mind. It works that way from the command line, too. Never tried >> it before. > >Forward slashes as path separator only works on NTFS volumes I believe. W

Re: How to detect the presence of a html file

2005-12-09 Thread Kent Johnson
Peter Hansen wrote: > Kent Johnson wrote: > >> 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') > > > Simpler still is almost always to use forward slashes instead: > > os.path.isfile('c:/bookmarks.

Re: How to detect the presence of a html file

2005-12-09 Thread Peter Hansen
Irmen de Jong wrote: > Forward slashes as path separator only works on NTFS volumes I believe. I'm not sure what they *don't* work on, but at the least they also work across the network as in: os.listdir('//server/shared/xfer') Maybe that still qualifies as "NTFS"... -Peter -- http://mail.

Re: How to detect the presence of a html file

2005-12-09 Thread Irmen de Jong
BartlebyScrivener wrote: >> Even weirder, > >> os.path.isfile(r'c://bookmarks.html') > > Never mind. It works that way from the command line, too. Never tried > it before. Forward slashes as path separator only works on NTFS volumes I believe. --Irmen -- http://mail.python.org/mailman/listinfo

Re: How to detect the presence of a html file

2005-12-09 Thread BartlebyScrivener
> Even weirder, > os.path.isfile(r'c://bookmarks.html') Never mind. It works that way from the command line, too. Never tried it before. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect the presence of a html file

2005-12-09 Thread BartlebyScrivener
Even weirder, os.path.isfile(r'c://bookmarks.html') also seems to work. How is that? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to detect the presence of a html file

2005-12-09 Thread Xavier Morel
Phoe6 wrote: > Operating System: Windows > Python version: 2.4 > > I have bookmarks.html and wumpus.c under my c: > > When I tried to check the presence of the bookmarks.html, I fail. > os.path.isfile('c:\bookmarks.html') > False os.path.isfile('c:\wumpus.c') > True > os.path.exi

Re: How to detect the presence of a html file

2005-12-09 Thread Peter Hansen
Kent Johnson wrote: > 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') Simpler still is almost always to use forward slashes instead: os.path.isfile('c:/bookmarks.html') os.path.isfile('c:/wumpus.c') T

Re: How to detect the presence of a html file

2005-12-09 Thread Phoe6
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 need

Re: How to detect the presence of a html file

2005-12-09 Thread Kent Johnson
Phoe6 wrote: > Operating System: Windows > Python version: 2.4 > > I have bookmarks.html and wumpus.c under my c: > > When I tried to check the presence of the bookmarks.html, I fail. > > os.path.isfile('c:\bookmarks.html') > > False > os.path.isfile('c:\wumpus.c') > > True The prob