at backyard

Color my life with the chaos of trouble.

Entries from 2017-09-28 to 1 day

Pythonで指定したディレクトリ内のファイル名リストを取得する

個人的なコードのメモ。備忘録 dir_name = "test_dir" json_file = "*.json" # 指定したディレクトリ内のjsonファイルの(./test_dir/*.json) # ファイル名(拡張子なし)をリストとして取得する file_names = [os.path.splitext(os.path.basename(f))[0] for f…