import os

# List of folder and file names
folder_names = [
    "SW_SD_Sequence_Startup_OverView",
    "SD_Sequence_Security_BootLoader",
    "SD_Sequence_PE_Security_BootLoader",
    "SD_Sequence_PE_OsSchedule",
    "SD_Sequence_System_00_InitTarget",
    "SD_Sequence_System_04_SleepOut",
    "SD_Sequence_System_04_StandbyOut",
    "SD_Sequence_Shutdown_OverView",
    "SD_Sequence_System_05_StandbyIn",
    "SD_Sequence_System_05_SleepIn",
    "SD_Sequence_System_05_J3_PowerCutOff",
    "SD_Sequence_System_05_U2A_PowerCutOff"
]

# Directory to create folders (current directory)
output_dir = "."

# Create each folder and .puml file
for folder_name in folder_names:
    folder_path = os.path.join(output_dir, folder_name)
    os.makedirs(folder_path, exist_ok=True)  # Create folder if it doesn't exist

    # Create a .puml file inside the folder with the same name
    puml_file_path = os.path.join(folder_path, f"{folder_name}.puml")
    with open(puml_file_path, 'w') as puml_file:
        puml_file.write("")  # Create an empty .puml file

    print(f"Created folder and .puml file: {puml_file_path}")
最后修改:2024 年 11 月 14 日
如果觉得我的文章对你有用,请随意赞赏