自动化创建项目标准脚本

 

#导入模块:
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("------------------\n"
"## 本程序实现的内容如下:\n"
"### 1. \n"
"### 2. \n"
"### 3. \n"
"### 4. \n"
"### 5. \n"
"### 6. \n"
"### 7. 退出程序\n"

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

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

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

"-------------\n")
posted @ 2019-11-16 08:39  干it的小张  阅读(224)  评论(0编辑  收藏  举报