記事一覧
【python】ディレクトリの存在確認
モジュール os.pathos.path
os.path.exists() #ファイルまたはディレクトリ確認
os.path.isfile() #ファイル確認
os.path.isdir #ディレクトリ確認
引数はpathの文字列を指定する。
python上では…
=====
import os
filepath="./data/example/dir/file.txt" #ファイルパス指
モジュール os.pathos.path
os.path.exists() #ファイルまたはディレクトリ確認
os.path.isfile() #ファイル確認
os.path.isdir #ディレクトリ確認
引数はpathの文字列を指定する。
python上では…
=====
import os
filepath="./data/example/dir/file.txt" #ファイルパス指