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
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.
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.
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
> 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
Even weirder,
os.path.isfile(r'c://bookmarks.html')
also seems to work.
How is that?
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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.exists('c:\wumpus.c')
True
>>> os.path.
11 matches
Mail list logo