zoukankan      html  css  js  c++  java
  • 自动化创建项目标准脚本

    #导入模块:
    import os

    #分别创建文件夹:
    os.makedirs("Course_selection/bin")
    os.makedirs("Course_selection/core")
    os.makedirs("Course_selection/conf")
    os.makedirs("Course_selection/db")
    os.makedirs("Course_selection/lib")
    os.makedirs("Course_selection/log")

    #展示目录信息:
    course_selection_list = os.listdir("Course_selection")
    print("您创建的项目目录有:",course_selection_list) #展示创建的目录信息

    #文件里面写入信息:
    with open("Course_selection/bin/start.py","w",encoding="utf-8") as f,
    open("Course_selection/core/admin_service.py","w",encoding="utf-8") as f1,
    open("Course_selection/conf/settings.py","w",encoding="utf-8") as f2,
    open("Course_selection/lib/commom.py","w",encoding="utf-8") as f3,
    open("Course_selection/README.md","w",encoding="utf-8") as f4:
    f4.write("------------------ "
    "## 本程序实现的内容如下: "
    "### 1. "
    "### 2. "
    "### 3. "
    "### 4. "
    "### 5. "
    "### 6. "
    "### 7. 退出程序 "

    "--------------- "
    "## 本程序运行环境: "
    "### 1.Python3.6.8 解释器 "

    "---------------- "
    "## 系统环境: "
    "#### Windows "

    "----------------- "
    "## 开发信息: "
    "### 作者: Zhangda "
    "### 时间: 2019年11月13日15:11:08 "
    "### 数据来源 : "

    "------------- ")
  • 相关阅读:
    每日一练leetcode
    每日一练leetcode
    每日一练 leetcode
    每日一练leetcode
    每日一练leetcode
    leetcode每日一练
    BigDecimal类 定义及用法
    每日一练leetcode
    每日一练leetcode
    字符串表达式校验&求值(C#实现) 附代码
  • 原文地址:https://www.cnblogs.com/zhang-da/p/11870523.html
Copyright © 2011-2022 走看看