[Python] Create multiple directories

Introduction

I found it cumbersome to create a directory for 15 lessons each time a university class started, so I decided to create multiple directories in Python.

code

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)

It will be created in the current directory.

Recommended Posts

[Python] Create multiple directories
Create a Python module
Create SpatiaLite in Python
Create a Python environment
[PostgreSQL] Create multiple instances
Multiple regression expressions in Python
Create a Wox plugin (Python)
Create a function in Python
Create a dictionary in Python
Create 3d gif with python3
Create gif video in Python
Create ToDo List [Python Django]
Specify multiple list indexes (Python)
Install multiple versions of Python
Create JIRA tickets using Python
Create a python numpy array
Decompress multiple compressed files (Python)
Avoid multiple loops in Python
Create a directory with python
Prohibit multiple launches in python
Extract multiple list duplicates in Python
[ev3dev × Python] Control of multiple motors
[Python] Random processing (create, select, sort)
Create plot animation with Python + Matplotlib
Create Awaitable with Python / C API
[Python] Sort iterable by multiple conditions
Python
Create a python GUI using tkinter
Create a DI Container in Python
Create folders from '01' to '12' with python
Create a Python environment on Mac (2017/4)
Create a shell script to run the python file multiple times
Create new application use python, django
Create a virtual environment with Python!
Create an Excel file with Python3
Create a binary file in Python
Create python directory Support if directory exists
Check and move directories in Python
Create Gmail in Python without API
Post multiple Twitter images with python
Animate multiple still images with Python
Create a python environment on centos
Create Python project documentation in Sphinx
Create a Python general-purpose decorator framework
Statistical test (multiple test) in Python: scikit_posthocs
Create a Kubernetes Operator in Python
5 Ways to Create a Python Chatbot
Multiple integrals with Python and Sympy
Delete multiple elements in python list
Create a random string in Python
[Python] Creating multiple windows with Tkinter
[Python] Create API to send Gmail
Easily create homemade RPA using Python
Create and read messagepacks in Python
Handle multiple python versions in one jupyter
Create a Python function decorator with Class
[Python] What is inherited by multiple inheritance?
Create your own Linux commands in Python
Automatically create Python API documentation with Sphinx
Create a new Python numerical calculation project
Create wordcloud from your tweet with python3