Python/pathlib/PurePath/anchor

من موسوعة حسوب
< Python‏ | pathlib‏ | PurePath
مراجعة 12:36، 3 أغسطس 2018 بواسطة مصطفى-عطا (نقاش | مساهمات) (أنشأ الصفحة ب'== المتغير <code>PurePath.anchor</code> == يجمع اسم السواقة مع مسار الجذر<syntaxhighlight lang="python3"> >>> PureWindowsPath('c:/Progra...')
(فرق) → مراجعة أقدم | المراجعة الحالية (فرق) | مراجعة أحدث ← (فرق)
اذهب إلى التنقل اذهب إلى البحث

المتغير PurePath.anchor

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

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

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

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

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