A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-August/102820.html below:

[Python-Dev] Drive suffix

[Python-Dev] Drive suffixRob Cliffe rob.cliffe at btinternet.com
Wed Aug 4 17:19:36 CEST 2010
Thanks for your replies, guys.
As it happens, what sparked the question was trying to determine in a 
platform-independent way whether a path consisted of a bare drive 
specification (e.g. "C:").  I guess
    os.path.splitdrive(MyPath)[1] == ""
takes care of that.
Rob Cliffe


----- Original Message ----- 
From: "Guido van Rossum" <guido at python.org>
To: "Rob Cliffe" <rob.cliffe at btinternet.com>
Cc: "Python-Dev" <python-dev at python.org>
Sent: Wednesday, August 04, 2010 4:10 PM
Subject: Re: [Python-Dev] Drive suffix


It's Windows specific syntax and always a colon. Use
os.path.splitdrive() to parse it. I don't think there's a need to add
a named constant for it (you're the first to ask, in my memory).

On Wed, Aug 4, 2010 at 7:45 AM, Rob Cliffe <rob.cliffe at btinternet.com> 
wrote:
> Is there a way of determining the suffix used after a drive letter to 
> denote
> a drive, e.g. on Windows the ":" in r"C:\Dir\Subdir\File.Ext" ? Or is the
> colon so universal that it is considered unnecessary? Should it be in the
> os module somewhere (as far as I can tell, it isn't, although every other
> kind of file path component separator seems to be) ?

-- 
--Guido van Rossum (python.org/~guido) 

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4