0
0

More than 1 year has passed since last update.

CSVファイルと同じ名前のディレクトリを作成しCSVファイルを格納

Last updated at Posted at 2022-04-12
import shutil
import os

for f in os.listdir(path='.'):
    if os.path.splitext(f)[1]=='.csv':
        dir_name=os.path.splitext(f)[0]
        os.mkdir(dir_name)
        shutil.move(f, dir_name)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0