الفرق بين المراجعتين ل"Python/pathlib/PurePath/anchor"

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

المراجعة الحالية بتاريخ 12:36، 3 أغسطس 2018

المتغير PurePath.anchor

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

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

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

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

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