Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Project Structure Creation Script
- Description:
- This script is designed to automatically generate a default directory structure for Python projects,
- aimed at ensuring a clean and efficient organization for development. It creates a series of directories
- and files that form the foundation of a well-structured application, including places for libraries,
- utilities, services, and tests, along with the initial setup for gitignore, requirements, and README files.
- Getting Started:
- 1. Ensure Python 3.x is installed on your system.
- 2. Save this script to your desired project root directory.
- 3. Run the script using the command `python <script_name>.py` in your terminal or command prompt.
- 4. The script will create the basic project structure under your current directory, including:
- - A source directory (`src`) with a subdirectory for the app, libraries (`libs`), utilities (`utils`),
- and services (`services`).
- - Placeholder files for the main application (`run.py`), project requirements (`requirements.txt`),
- and documentation (`README.md`).
- 5. After running, proceed to populate the generated files and directories with your project's code and documentation.
- This script is provided by RapidMod, a platform dedicated to enhancing the development workflow through
- streamlined project setup and management tools. For more tools and resources, visit https://rapidmod.io/.
- Note: This is an initial structure setup. Depending on the project's evolution, modifications might be required
- to accommodate specific needs or preferences.
- Author: RapidMod
- Website: https://rapidmod.io/
- """
- import os
- dirs = [
- "src/app/libs",
- "src/app/utils",
- "src/app/services",
- "tests",
- ]
- files = [
- "src/app/run.py",
- ".gitignore",
- "requirements.txt",
- "README.md",
- ]
- for directory in dirs:
- os.makedirs(directory, exist_ok=True)
- print(f"Directory {directory} created.")
- for file in files:
- with open(file, 'w') as fp:
- pass # Just to create the file
- print(f"File {file} created.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement