python:pathlib

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
python:pathlib [2020/04/04 07:31] ともやんpython:pathlib [2023/05/27 09:00] (現在) – [glob.iglob() の実装] ともやん
行 1: 行 1:
-<html> +====== pathlib, glob.iglob(), os.walk() ======
-  <style> +
-    #result pre, #mincode pre { +
-      /*height: 300px;*/ +
-      overflow: scroll; +
-      overflow-x: hidden; +
-      font-size: 10px; +
-    } +
-    #mincode_long pre { +
-      height: 400px; +
-      overflow: scroll; +
-      overflow-x: hidden; +
-      font-size: 10px; +
-    } +
-    #mintbl table { +
-      font-size: 12px; +
-    } +
-    .dokuwiki .plugin_wrap table { +
-      width: auto; +
-    } +
-  </style> +
-</html> +
-====== pathlib, glob, os ======+
  
 ===== os.walk() の実装 ===== ===== os.walk() の実装 =====
-**os.walk(top, topdown=True, onerror=None, followlinks=False)** は、内部的には **os.scandir(path='.')** によって処理される。\\+<html><code>os.walk(top, topdown=True, onerror=None, followlinks=False)</code></html> は、内部的には <html><code>os.scandir(path='.')</code></html> によって処理される。\\
  
 ===== glob.iglob() の実装 ===== ===== glob.iglob() の実装 =====
-**glob.iglob(pathname, *, recursive=False)** は、内部的には **os.scandir(path='.')** によって処理される。\\ +<html><code>glob.iglob(pathname, *, recursive=False)</code></html> は、内部的には <html><code>os.scandir(path='.')</code></html> によって処理される。\\ 
-**os.scandir(path='.')** によって取得された内容は **list()** 化されて **fnmatch.filter(names, pattern)** によってフィルター処理される。\\ +<html><code>os.scandir(path='.')</code></html> によって取得された内容は **list()** 化されて <html><code>fnmatch.filter(names, pattern)</code></html> によってフィルター処理される。\\ 
-**fnmatch.filter(names, pattern)** の **pattern** は **fnmatch.translate(pattern)** で正規表現に変換してから **re.compile()** される。ここで注意が必要なのは、 **pattern** は **__Unix Shell Style__** のパターンであって正規表現は利用できない。\\+ここで注意が必要なのは、 **pattern** は **__Unix Shell Style__** のパターンであって正規表現は利用できない。\\ 
 +<html><code>fnmatch.filter(names, pattern)</code></html> の **pattern** は <html><code>fnmatch.translate(pattern)</code></html> で正規表現に変換してから <html><code>re.compile()</code></html> される。\\
 \\ \\
 **OK パターン**\\ **OK パターン**\\
行 44: 行 23:
 </code> </code>
  
-<WRAP prewrap 100% #mincode_long>+<WRAP mincode_long>
 <code python python38/Lib/glob.py> <code python python38/Lib/glob.py>
 """Filename globbing utility.""" """Filename globbing utility."""
行 229: 行 208:
 ノート(翻訳) Unix ベースのシステムでは、scandir() はシステムの opendir() 関数と readdir() 関数を使用します。 Windows では、Win32 FindFirstFileW 関数と FindNextFileW 関数を使用します。 ノート(翻訳) Unix ベースのシステムでは、scandir() はシステムの opendir() 関数と readdir() 関数を使用します。 Windows では、Win32 FindFirstFileW 関数と FindNextFileW 関数を使用します。
 </note> </note>
-<WRAP prewrap 100% #mincode_long>+<WRAP mincode_long>
 <code c cpython/Modules/posixmodule.c> <code c cpython/Modules/posixmodule.c>
 /*[clinic input] /*[clinic input]
  • python/pathlib.1585953080.txt.gz
  • 最終更新: 2020/04/04 07:31
  • by ともやん