madhanl6/ML-Template

Receive base_dir as a parameter

Closed this issue · 2 comments

This base_dir variable could be a parameter to allow running the script easily without changing the code

image

With this change, if the user runs the script without providing a base directory argument, it will print the usage message and exit with a non-zero status code (1) to indicate an error.

update the code like this

def main():
    if len(sys.argv) < 2:
        print("python script.py <base_directory>")
        sys.exit(1)
    
    base_dir = sys.argv[1]
    create_project_structure(base_dir)