需求: 使用os模块创建如下目录结构 glance/ ├── __init__.py ├── api │ ├── __init__.py │ ├── policy.py │ └── versions.py ├── cmd │ ├── __init__.py │ └── manage.py └── db ├── __init__.py └── models.py #创建文件夹 #创建文件 os.makedirs("glance/api") os.makedirs("glance/cmd") os.makedirs("glance/db") open("glance/api/__init__.py","w").close() open("glance/api/policy.py","w").close() open("glance/api/versions.py","w").close() open("glance/cmd/__init__.py","w").close() open("glance/cmd/namage.py","w").close() open("glance/db/__init__.py","w").close() open("glance/db/models.py","w").close()