RapidMod icon

Default Python Application Script

RapidMod | PRO | 04/04/24 12:59:44 PM UTC | 0 ⭐ | 2250 👁️ | Never ⏰ | [Script]
Python |

2.04 KB

|

None

|

0 👍

/

0 👎

"""
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.")

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎