LoginSignup
0
1

More than 3 years have passed since last update.

【Python】複数のディレクトリを作成する

Posted at

はじめに

毎回、大学の授業が開講するたびに15回分の授業数のディレクトリを作成するのが面倒だと思ったので、Pythonで複数のディレクトリを作成することにしてみました。

コード

multiple_dir.py
import os


dir_num = [i for i in range(1, 16)]

for num in dir_num:
    dir_name = 'No.' + str(num)
    os.mkdir(dir_name)

尚、カレントディレクトリで作成されます。

0
1
2

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
1