「Python」os.path.join関数でファイルパスを取得するサンプル
説明
os.path.join パスを結合します。
サンプルコード
import os
for current_dir, dirs, files in os.walk('.'):
for filename in files:
print(os.path.join(current_dir, filename))
Coding Changes the World
説明
os.path.join パスを結合します。
サンプルコード
import os
for current_dir, dirs, files in os.walk('.'):
for filename in files:
print(os.path.join(current_dir, filename))