Python/pathlib/PurePath/anchor

من موسوعة حسوب
< Python‏ | pathlib‏ | PurePath
اذهب إلى التنقل اذهب إلى البحث

المتغير PurePath.anchor

يجمع اسم السواقة مع مسار الجذر

>>> PureWindowsPath('c:/Program Files/').anchor
'c:\\'

>>> PureWindowsPath('c:Program Files/').anchor
'c:'

>>> PurePosixPath('/etc').anchor
'/'

>>> PureWindowsPath('//host/share').anchor
'\\\\host\\share\\'