0
1

More than 3 years have passed since last update.

講義用のフォルダをまとめて作成する[python]

Posted at

フォルダーを再帰的に作りたい

いままでは新学期になるたびに講義ファイルをまとめるフォルダーを作っておりました。
大した労力じゃないかもしれないけど、地味に大変だから何とかしたい!

コード

フォルダーを作りたい場所で動かすと出来上がり。
はじめに一番上になるフォルダーの名前を決めることができます。
曜日や時限数は調整してみてください。

foldermaker.py
import os

week = ('1_Monday', '2_Tuesday', '3_Wednesday', '4_Thursday', '5_Fliday')
period = ('1', '2', '3', '4', '5')

title = input('input folder name...')

for w in week:
    for p in period:
        os.makedirs(title + '/' + w + '/' + p)

参考

0
1
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
1