This Python application reads a hierarchical structure from a text file (dirs.txt
) and automatically creates directories and subdirectories based on the indentation levels specified in the file. It creates all the directories inside a base directory (/cheatsheets/
), which can be customized.
This tool is useful for creating complex directory structures quickly based on predefined hierarchies, such as those used for educational purposes or any other organizational needs.
- Reads a file (
dirs.txt
) that defines directory structures using indentation. - Creates directories and subdirectories according to the specified hierarchy.
- Supports dynamic creation of directories based on the hierarchy levels in the text file.
- Handles errors like missing base directories by automatically creating them if necessary.
- Easily customizable for different levels of indentation or custom base directories.
This script uses only built-in Python modules, so no additional dependencies are required.
Make sure you have Python 3.x installed. You can check your Python version with:
python --version
If the dirs.txt
file contains the following:
Secundario
Bachiller
Primer Año
Matemáticas
Física
Segundo Año
Matemáticas
Física
The following directories will be created:
/cheatsheets/Secundario/Bachiller/Primer Año/Matemáticas
/cheatsheets/Secundario/Bachiller/Primer Año/Física
/cheatsheets/Secundario/Bachiller/Segundo Año/Matemáticas
/cheatsheets/Secundario/Bachiller/Segundo Año/Física