#pythonでp.iterdir ()でp.glob ('**/*')でp.rglob ('*')で単独 (iterdir)、複数 (glob)ディレクトリからファイル名を検索する方法vv #pythonでp.read_textでファイルの内容を表示する方法vv [x for x in f_hmfl if re.search ('srh',x.name)] [x for x in ...
ファイルが5個なら30分、10個なら1時間。 しかも集中力が切れたころに「1行ずれてた」が起きる。 この作業、Pythonの glob を使えば20行で終わります。 ファイルが10個でも100個でも処理時間は変わりません。 この記事では、前回の「読む・書く・色付け」に ...
A look at the benefits of using pathlib, the "object-oriented way of dealing with paths". Working with files is one of the most common things developers do. After all, you often want to read from ...